Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Pass value to Dataset instead of Parameter Expand / Collapse
Author
Message
Posted Friday, June 21, 2013 12:02 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, June 24, 2013 1:20 PM
Points: 70, 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

Post #1466330
Posted Friday, June 21, 2013 12:11 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, June 24, 2013 1:20 PM
Points: 70, 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?
Post #1466335
Posted Friday, June 21, 2013 1:02 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, June 25, 2014 9:30 AM
Points: 67, Visits: 342
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.
Post #1466358
Posted Monday, June 24, 2013 8:04 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, June 24, 2013 1:20 PM
Points: 70, 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
Post #1466754
Posted Monday, June 24, 2013 1:20 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, June 24, 2013 1:20 PM
Points: 70, Visits: 86
=Lookup(1,Fields!STORE_NO.Value,Fields!STORE_NAME.Value,"StoreByBrandHasLoyaltyRewards")

is what I was looking for

see hard coded 1

Post #1466874
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse