Having different reports display on one page

Last post 05-13-2008 1:18 AM by joseabie. 2 replies.

Sort Posts:

  • Having different reports display on one page

    05-09-2008, 11:22 AM
    • Loading...
    • ams015
    • Joined on 11-25-2007, 5:37 PM
    • Posts 17

    Is it possible to have one viewer but load a different report source for different users? Say if I have a customer that needs to access one report and another customer access a different one? If so how would I go about doing it?

  • Re: Having different reports display on one page

    05-09-2008, 12:25 PM
    • Loading...
    • TonyDong
    • Joined on 02-01-2006, 6:30 PM
    • BC, Canada
    • Posts 642

    Yes, on report load, you can load different report base on your paremeter like following code

    string reportName="abc.rpt";

    DataTable dt=GetFromYourParameterResult();

    ReportDocument crRptDoc = new ReportDocument();

    crRptDoc.Load(Request.PhysicalApplicationPath.ToLower() + reportName);

    crRptDoc.Refresh();

    crRptDoc.SetDataSource(dt);

    crvExploration.DisplayToolbar = true;

    crvExploration.DisplayGroupTree = false;

    crvExploration.ReportSource = crRptDoc;

    crvExploration.DataBind();

    Don't forget to click "Mark as Answer" on the post(s) that helped you.
  • Re: Having different reports display on one page

    05-13-2008, 1:18 AM
    • Loading...
    • joseabie
    • Joined on 04-07-2008, 12:56 AM
    • Abu Dhabi
    • Posts 82

    ok a small example,,

    imagine you are enterng the user name in a textbox, in the coding,

    if Textbox1.text="ABC" Then

    Rpt.Load(Server.MapPath("ABC.rpt"))

    Else IF Textbox1.text="XYZ" Then

    Rpt.Load(Server.MapPath("XYZ.rpt"))

    End If

     

    Just try... Wink

Page 1 of 1 (3 items)