简体   繁体   中英

SSRS - Report Based on Parameter Selection

We have a web based report we are moving to SSRS. In the SSRS report, I need one report to be able to call three different stored procedures based on the selection of a parameter value, and the output / report display would also be different.

I believe I can create three different datasets for each procedure but I don't want all three to actually run when the user selects "View Report", as that would be excessive execution.

How could I get only one procedure to be called and only the correct report section to show based on the parameter?

Let me try and give an example if the above doesn't make sense:

Parameter: Report Type Values: Day / Month / Year

If the user selects "Day" for the report type parameter, I need to call "SP_ReportDay". If the user selects "Month", I need to call "SP_ReportMonth" and if the user selects "Year" I need to call "SP_ReportYear".

Each report type would have different data displayed. It isn't the same columns for ecah report and the data displayed is different.

How would I show / hide sections based on the selection criteria along with calling the correct procedure?

If the result sets are different, you don't have many choices besides running all three sprocs. BUT you can add a parameter to each sproc that tells them, respectively, not to actually return any results. Your report can set this parameter at run-time. You'll have to modify the body of your sprocs accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM