Stored Procedure with parameters in a sub report

Ali Ahad 71 Reputation points
2023-07-27T22:57:55.1266667+00:00

I have a main report where I display percentages for last thirteen months screen shot below:

Main_report

So when the user clicks on the percentages of any month a new sub report should open with all the details for that month. I am using SP for the sub report which got a file month parameter, so when I execute the SP for any of those months in SSMS using the following command:

exec mySP '2023-06-01'

I got the results but don't know how to incorporate that in SSRS.

Any help is appreciated.

Thanks,

Ali.

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,727 questions
{count} votes

2 answers

Sort by: Most helpful
  1. AniyaTang-MSFT 12,216 Reputation points Microsoft Vendor
    2023-07-28T06:23:28.4866667+00:00

    Hi @Ali Ahad

    For how to add subreports and parameters to paginated reports, you can refer to this document: https://learn.microsoft.com/en-us/sql/reporting-services/report-design/add-a-subreport-and-parameters-report-builder-and-ssrs?view=sql-server-ver16.

    Best regards,

    Aniya

    0 comments No comments

  2. Wilko van de Velde 2,146 Reputation points
    2023-07-28T07:43:26.0966667+00:00

    Hi @Ali Ahad ,

    In addition to @AniyaTang-MSFT , check this blog for adding a stored procedure as a dataset for a report:
    https://www.sqlservercentral.com/articles/ssrs-report-for-stored-procedure-with-parameters

    Kind regards,
    Wilko


    If the answer is the right solution, please click "Accept Answer". If you have extra questions about this answer, please click "Comment".

    0 comments No comments