Friday, March 30, 2012

Report Parameter Populating Another Report Parameter

OK, I'm pretty sure that the answer to my questions is "no", but the boss is pushing, and I thought I'd double check.

I want the selection of one report parameter to decide what shows up for another report parameter. Specifically in my case it has to do with dates. I have narrowed the results down to monthly dates, meaning that the starting dates always start with mm/1/yyyy and the ending dates are always mm/31/yyyy (for a 31 day month).

The boss wants the ending dates to always be >= the month of the starting dates. So, if the user choose 1/1/2007 for starting, the minimum ending date would be 1/31/2007, etc.. Since the parameters are loaded at report initiation, and SSRS isn't really event driven, I didn't think this was possible. I just wanted to make sure before I tell the boss that it's not. Please advise.

You can definitely do this, I do something similar in nearly all my reports. In the layout tab go to the Report/Parmaters menu. The order in which the parameters are evaluated. Just make sure that the end date parameter comes after the start date parameter. If the start date parameter is call "SartDate" you can use it in the expression for the default value of the end date. In the expression editor you can navigate to the parameters to help get the syntax correct. Using DateAdd() in conjunction with with the StartDate.value and setting the "EndDate" parameter to Hidden and/or Internal should do the trick.

Dick Campbell

|||

Hello:

Just when I thought I was starting to get a handle on "populating report parameter from another report parameter" and then boom. I'm attempting to populate a report parameter with the code below. This code below is what I'm using to populate my report parameter. I run the dataset individually it works fine. There are 3 datasets ahead of this one and one of them pulls the values for @.Client and @.Product. Any thoughts will be appreciated.

Code Snippet

SELECT HdngCode
FROM PkgHdngs
WHERE (ClientID = @.Client) AND (ProductID = @.Product) AND (HdngCode IS NOT NULL)
GROUP BY HdngCode
ORDER BY HdngCode

No comments:

Post a Comment