Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paramater Default Value from Dataset?

Status
Not open for further replies.

sconti11

Technical User
Jan 31, 2011
95
US
I have been searching this site as well as others to solve this problem.

I need to set a parameters default value to the resultset of a dataset within the reports. So here is the scenario:

I have a report that uses a parameter called @Franchise, this is a unique id(FranchiseID) of the user. Right now it is a drop-down list that gets it's values from a data set.

Now the end user would like this to be automated so that the reports will recognize the user and pass the appropriate FranchiseID. So I know that I can get the user by User!UserID.

I then created a new table in SQL to hold the UserID and FranchiseID. I then upadated the orginal dataset that populates the @Franchise parameter to the following:

SELECT franchiseID, franchiseNM
FROM FranchiseUsers
WHERE (UserID = @user)

The @user parameter has a default value of User!UserID.

But here is where I am stumped, I think I need to set the @Franchise parameter's default value to the resultset of the dataset seen above. I just do not know how????

Please advise if I am on the right path, or if there is a better way to do this.

 
I found my simple solution...it all came down to a missing = sign!!

I did not see it, but the parameter @user was set to have a default value of User!UserID when it should have said =User!UserID.

Well...things are looking up!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top