I have a SSRS report containing two data sets which calls a stored procedure to get the data.
The Stored procedure code is something like below:
CREATE PROCEDURE dbo.usp_get_data
IF @Output = 'details'
SELECT * FROM AdventureWorks.dbo.details;
IF @Output = 'summary'
SELECT * FROM AdventureWorks.dbo.Summary;
In SSRS, one data set is for summary and another one is for details.
In the data set, I have hardcode the @output = 'details' for data set 1, and hardcoded @output = 'summary' for data set 2.
When I refresh data set 2 which is for summary, SSRS refreshes the dataset with details fields instead of the summary fields. I think it is doing that because details IF block is the first one in the code.
Can you please help me in fixing this issue and get SSRS wit refresh with correct list of fields?