0
votes

I'm relatively new to SSRS 2005. I've built simple reports, and spreadsheets but I'm just beginning to delve into the world of fun that is SSRS/RDL. I'm trying to pass one (custom/non-query) parameter from one report (*.rdl) to another. While logically I would like to add a global variable, there doesn't seem to be any straightforward method/technique for doing what I want. It seems each page/report has its own parameters and reports aren't allowed to share each other's info.

I'm trying to simply hide objects/items based on an option that the user selects. Should a user select option A or B, I want to simply hide certain objects on multiple reports (within the same project) based on their selection. I simply check for the parameter value within an expression for the visibility property in any given object. Nothing complicated really. I've tested it out and on just one report by itself, it works. But try to get one report to read that value on another report, and there's no clear path in doing so.

Now as I've grown accustomed to SSRS, I believe there's the "normal" programmer's way and then there's the "SSRS" way. Both are mutually exclusive. So either I'm trying to do something that will never be allowed, it's a "built-by-design" feature and/or I'm going about it the wrong way.

Ideas? Suggestions? Maybe I'm going about this the wrong way.

2

2 Answers

1
votes

Ok, so there's a only a few ways to pass parameters from one page to the next. I (eventually) discovered that I was simply trying to pass a boolean from one to the next. The data was not from the database, it was something manual ('true/false'). At first I thought I needed something akin to a global variable which there are a few built-in globals in SSRS. But as I found out, you can't add anything to that collection.

So on this one report I have an image pointing to the 'Next' page of the report. Within that object/image, you can set navigation parameters on that object/image. Makes sense so far.

On the following page, your report parameters must match the position in which the variable was listed from the following page. I guess SSRS passes a non-key based arrays from one report to the next so index/position is vital for getting the parameters right. Hence the arrows allowing you to adjust the parameter order. That was what tipped me off, but I thought it was SSRS was more adept then that in the sense that parameters being passed had to just match in name, not position.

(IMHO) as I see things, SSRS has/tries/must remain fairly static. There's no real sense of events, OO, etc. and yet SSRS seems to stitch elements from VB, VBA (expressions), SQL/T-SQL altogether and spew forth a usable product. I guess that's my newb perspective. I'm sure it will change with time.

0
votes

Using subreports might allow you the functionality you need. Otherwise, the only other way I know of to "pass" parameters from one report to the next is using the query string.