user6635509
user6635509

Reputation:

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?

Upvotes: 0

Views: 947

Answers (1)

Xavier J
Xavier J

Reputation: 4626

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.

Upvotes: 0

Related Questions