September 28, 2017 at 11:42 am
Is it possible to replicate this code from a stored procedure in a SSRS dataset?
exec @dtEffective = dbo.selUpdEnv 'PrevBusDt','=',@cdUser,'N'
What I'm trying to do is save the effective date in a variable and display the date in a textbox.
I tried creating a parameter called dtEffective and use it in the dataset. But it didn't save the value.
September 28, 2017 at 12:01 pm
rs80 - Thursday, September 28, 2017 11:42 AMIs it possible to replicate this code from a stored procedure in a SSRS dataset?exec @dtEffective = dbo.selUpdEnv 'PrevBusDt','=',@cdUser,'N'
What I'm trying to do is save the effective date in a variable and display the date in a textbox.
I tried creating a parameter called dtEffective and use it in the dataset. But it didn't save the value.
You need to define it as an OUTPUT parameter to make the stored procedure return the correct value.exec dbo.selUpdEnv 'PrevBusDt','=',@cdUser,'N', @dtEffective OUTPUT
However, I'm not sure if you need to do something else in SSRS. You might need to configure something else.
September 28, 2017 at 12:06 pm
All you need to do is output the input parameter as part of the final SELECT in your stored procedure as a column, and give it a column name. Variables that are passed in to stored procedures are perfectly legal to be in any SELECT anywhere in the stored procedure. Now with that field in the dataset, and named as you saw fit, you can then use that field in any SSRS report.
Steve (aka sgmunson) 🙂 🙂 🙂
Rent Servers for Income (picks and shovels strategy)
September 28, 2017 at 1:07 pm
Thanks for the answers. Unfortunately, it's an existing SP so I can't modify it.
September 28, 2017 at 1:44 pm
rs80 - Thursday, September 28, 2017 1:07 PMThanks for the answers. Unfortunately, it's an existing SP so I can't modify it.
Okay, then what do you mean by "save" that parameter value? Display it in the report? You can create a textbox and have it's value be an expression that references any of the existing report parameters.
Steve (aka sgmunson) 🙂 🙂 🙂
Rent Servers for Income (picks and shovels strategy)
September 28, 2017 at 3:39 pm
sgmunson - Thursday, September 28, 2017 1:44 PMOkay, then what do you mean by "save" that parameter value? Display it in the report? You can create a textbox and have it's value be an expression that references any of the existing report parameters.
The expression to do so would be (assuming your parameter is called "MyParameter"):=Parameters!MyParameter.Value
or=Parameters!MyParameter.Label
Depending on if you want to return the Value or the Label (surprise!) of the parameter.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply