SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Pass value to Dataset instead of Parameter


Pass value to Dataset instead of Parameter

Author
Message
xgcmcbain
xgcmcbain
SSC-Enthusiastic
SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)

Group: General Forum Members
Points: 110 Visits: 86
This is very simple

lets say I have 2 textboxes. in one textbox is just a value of 1

The other textbox I want to execute my DataSet which executes a stored procedure passing the id of a customer.

so if I wanted the last name of the customer to show up in textbox2 , based on a hard coded value of 1 in textbox one and my Dataset1 is a storedprocedure which expects the id being passed.




To make this even more simple

Lets say I have a textbox and I want to execute a DataSet and pass my own hard coded value as its stored procedures expected parameter, instead of a SSRS parameter. I want to leave the Dataset parameter value blank and pass values to it
xgcmcbain
xgcmcbain
SSC-Enthusiastic
SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)

Group: General Forum Members
Points: 110 Visits: 86
I can see maybe using a hidden report parameter or a report variable, but how to I change it on the fly. in expressions can you execute more then one statement?

or am I going to have to do something like custom code
=Code.CallMyStoredProcedure(1)

if so what would CallMyStoredProcedure look like and where does it go?
Raul Undreiner
Raul Undreiner
SSC-Enthusiastic
SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)SSC-Enthusiastic (138 reputation)

Group: General Forum Members
Points: 138 Visits: 382
If I'm getting this right, that is actually what parameters are used for. Get a value for something that affects the result of the report.
When you create a parameter for the report do not assign a default value so when you open the report it will ask for a value to execute the query and obtain the resulting report. Just make sure that the query/stored procedure receives the value of the parameter and it is used on the query as a filter.
xgcmcbain
xgcmcbain
SSC-Enthusiastic
SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)

Group: General Forum Members
Points: 110 Visits: 86
i already know the value for it its textbox2.value, but it doesn't let you assign textboxes as values only parameters or tablix datasets fields.

im sure ill figure it out today, its Monday and not EOD Friday thanks for you help
xgcmcbain
xgcmcbain
SSC-Enthusiastic
SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)

Group: General Forum Members
Points: 110 Visits: 86
=Lookup(1,Fields!STORE_NO.Value,Fields!STORE_NAME.Value,"StoreByBrandHasLoyaltyRewards")

is what I was looking for

see hard coded 1
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search