Passing Parameter to Report

  • Hello,

    I have a report created in which two datasets are based on two different stored procedures. The stored procedures both have a single parameter called @WorkOrderID.

    I currently have a report parameter set up to where the user has to input the @WorkOrderID parameter (integer) to view the correct data in the report. What I want to do is 'pass' the WorkOrderID from an aspx page to the report automatically without the user having to do this at the report. The user would simply click a button labled 'Preview Report' from the aspx page, the report would open, and show the correct data based on the WorkOrderID that was present in the aspx page.

    So I have two questions;

    1. What approach do I take to open the report from the aspx page using the click event of a button (C#)?

    2. How would I 'pass' the parameter value that the report needs in order to show the correct data?

    I come from an MS Access background, and it was a very simple thing to do with Access Reports. I have searched on the web and through the Microsoft documentation for samples on how to do these things, but I have not been able to find anything.

    Any specific or general help would be greatly appreciated.

    Thanks!

    CSDunn

  • Hi,

    Reporting services allows you to do lots of things by creating the correct URL.  Build this URL under your button and pass the parameter as part of it.

    The URL should look similar to this...

    <A href="http:///reportserver?//&WorkOrderID=1234">http://<servername>/reportserver?/<reportfolder>/<reportname>&WorkOrderID=1234

    Hope this helps.

    Cheers,

    Neal

  • Neal,

    Thank you for your help!

    CSDunn

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply