locked
Report Viewer Control and Passing Paramaters RRS feed

  • Question

  • User1357551236 posted

    Hi Guys, 

    I have a situation where I am created a WEB APP that has a submit button on a FORM on the first ASPX page.  I have some VB code behind that to generate Header and Lines records in two tables with a HEADER ID as my PK.  

    I have another ASPX page which has the Report Viewer control on it and prompts me for the HEADER ID and displays the report correctly when I manually enter the HEADER ID.

    What I am now trying to achieve is when the user clicks the submit button on the FORM I want it to redirect to the other ASPX page and pass through the Header ID as a Parameter and automatically display the REPORT. 

    Can somebody please point me in the right direction to achieve this.

    Thanks
    Joel 

    Wednesday, September 1, 2010 12:26 AM

Answers

  • User1471008070 posted

    Hi Jimbobjr,

    From your information, I think Drill-through function is just what you need. A drillthrough report typically contains parameters that are passed to it by the parent report. In the sales summary report example, the drillthrough report contains a parameter that takes the order as a value. The summary report includes a drillthrough report link for each order number, which opens the target detail report when clicked and passes the order ID to it.

    To add a drillthrough report

    1. Open the client report definition (.rdlc) file in graphical design mode.
    2. Right-click the text box or image to which you want to add a link and then click Properties.
    3. On the Navigation tab, select Jump to Report.
    4. Type or select a report name. The report must be a .rdlc file that is part of the same project.
    5. To set parameters to pass to the drillthrough report, click Parameters, and then do the following:
    • In Parameter Name, type the names of the report parameters in the drillthrough report.
    • In Parameter Value, type or select the values to pass to the parameters in the drillthrough report.

    To supply data for drillthrough reports, your application must handle the Drillthrough event of the ReportViewer object. One of the arguments passed to the Drillthrough event hander method is DrillthroughEventArgs. DrillThroughEventArgs has a Report property which represents the drillthrough report. In the event handler, the host application may examine the values of parameters passed to the drill-through report by calling the GetParameters() method on the drillthrough report. The host application must then supply the data for the drillthrough report using the DataSources property of the drillthrough report.

    For the code sample, please click this link http://www.codeproject.com/KB/aspnet/DrillThroughReport.aspx

    If you have any question, please feel free to ask.

    Best regards,

    Challen Fu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 7, 2010 8:06 AM

All replies

  • User-1802908944 posted

    It seems like your report need parameter to open. You can pass the parameter like

    http://forums.asp.net/p/1570791/3936635.aspx#3936635

    http://forums.asp.net/p/1570463/3934995.aspx#3934995 

    Wednesday, September 1, 2010 2:08 AM
  • User1357551236 posted

    Thanks for that.

    That would be perfect, the question is how do I do that.  Surely I have to link the URL parameter to the report with VB code or JS code somehow?


    Wednesday, September 1, 2010 2:16 AM
  • User1471008070 posted

    Hi Jimbobjr,

    From your information, I think Drill-through function is just what you need. A drillthrough report typically contains parameters that are passed to it by the parent report. In the sales summary report example, the drillthrough report contains a parameter that takes the order as a value. The summary report includes a drillthrough report link for each order number, which opens the target detail report when clicked and passes the order ID to it.

    To add a drillthrough report

    1. Open the client report definition (.rdlc) file in graphical design mode.
    2. Right-click the text box or image to which you want to add a link and then click Properties.
    3. On the Navigation tab, select Jump to Report.
    4. Type or select a report name. The report must be a .rdlc file that is part of the same project.
    5. To set parameters to pass to the drillthrough report, click Parameters, and then do the following:
    • In Parameter Name, type the names of the report parameters in the drillthrough report.
    • In Parameter Value, type or select the values to pass to the parameters in the drillthrough report.

    To supply data for drillthrough reports, your application must handle the Drillthrough event of the ReportViewer object. One of the arguments passed to the Drillthrough event hander method is DrillthroughEventArgs. DrillThroughEventArgs has a Report property which represents the drillthrough report. In the event handler, the host application may examine the values of parameters passed to the drill-through report by calling the GetParameters() method on the drillthrough report. The host application must then supply the data for the drillthrough report using the DataSources property of the drillthrough report.

    For the code sample, please click this link http://www.codeproject.com/KB/aspnet/DrillThroughReport.aspx

    If you have any question, please feel free to ask.

    Best regards,

    Challen Fu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 7, 2010 8:06 AM
  • User481172561 posted

    You might take at look at:

    www.rptgen.com

    Thanks

     

    Friday, July 1, 2011 3:39 PM