locked
How to pass parameter value to my ssrs report from an external source. RRS feed

  • Question

  • Hi

       How can I pass parameter value to my reporting services from some other website.

    I have to display a record based on ID value. This ID value has to be passed from click of button on website. How can I pass that ID value as my report parameter.


    • Edited by Vismaad Friday, October 27, 2017 1:31 PM
    Friday, October 27, 2017 1:31 PM

Answers

  • Hi Vismaad,

    As I mentioned above, you can't pass the ID to report directly when you click the Export Button, one workaround is that you could get the ID, then pass it by web portal URL.

    Before you pass the parameter, you need to define this parameter in report like below

    Then you deploy it on Report Manager and pass the parameter in URL.

    Best Regards,
    Zoe Zhi


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Visakh16MVP Wednesday, November 1, 2017 6:09 AM
    • Marked as answer by Vismaad Wednesday, November 1, 2017 11:10 AM
    Wednesday, November 1, 2017 5:54 AM

All replies

  • Pass a Report Parameter Within a URL

    A Fan of SSIS, SSRS and SSAS

    Friday, October 27, 2017 1:56 PM
  • Hi

       How can I pass parameter value to my reporting services from some other website.

    I have to display a record based on ID value. This ID value has to be passed from click of button on website. How can I pass that ID value as my report parameter.


    Assuming you've ID as a parameter in the report 

    you can use a URL like this

    <report viewer url>? <full report path> &ID=<your column value>

    see

    https://docs.microsoft.com/en-us/sql/reporting-services/pass-a-report-parameter-within-a-url


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Friday, October 27, 2017 2:50 PM
  • Hi

        This is the url where my report is running

        http://localhost/Reports/report/SampleReports/rptReportInformation. When i go to this url I pass ID vale to text box and view my report. Now, If I try to pass ID vale in above url, I get to see error.

    Thanks! 

    Friday, October 27, 2017 3:59 PM
  • Hi

        This is the url where my report is running

        http://localhost/Reports/report/SampleReports/rptReportInformation. When i go to this url I pass ID vale to text box and view my report. Now, If I try to pass ID vale in above url, I get to see error.

    Thanks! 

    This doesnt look like usual report viewer url

    are you using a custom website?


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Friday, October 27, 2017 4:08 PM
  • Take a look at https://www.mssqltips.com/sqlservertip/1336/pass-parameters-and-options-with-a-url-in-sql-reporting-services/


    A Fan of SSIS, SSRS and SSAS


    Friday, October 27, 2017 6:02 PM
  • As Vismaad,

    As I know, when you run the report which contains parameter, we need to pass parameter in report before preview the report. So we can't extract the values by clicking the button on other website and passing the parameter value to report manager directly.

    As other people mentioned, you could pass parameter values on URL manually. You need to define the parameter in report and use corresponding parameter in textbox expression, then pass parameter like below

    Best Regards,
    Zoe Zhi


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, October 30, 2017 6:05 AM
  • We have a website with export button. I will get ID at click of that Export button. How can I pass that ID to my report?

    I am able to pass parameter in box in webservice url. Need to customise it.

    Tuesday, October 31, 2017 12:11 PM
  • Hi Vismaad,

    As I mentioned above, you can't pass the ID to report directly when you click the Export Button, one workaround is that you could get the ID, then pass it by web portal URL.

    Before you pass the parameter, you need to define this parameter in report like below

    Then you deploy it on Report Manager and pass the parameter in URL.

    Best Regards,
    Zoe Zhi


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Visakh16MVP Wednesday, November 1, 2017 6:09 AM
    • Marked as answer by Vismaad Wednesday, November 1, 2017 11:10 AM
    Wednesday, November 1, 2017 5:54 AM