Groups | Blog | Home
all groups > sql server reporting services > december 2004 >

sql server reporting services : Calling GetReportParameters within a report Code block?


burt4684 NO[at]SPAM gmail.com
12/30/2004 8:03:26 AM
I want to write a Code block routine that returns the parameter Prompts
and ValidValue that was selected from within the report. Can I access
the ReportParameters collection (not the parameters collection, but the
actual parameter definitions collection) from within a Code block?
Thanks,

--jason
Jason Burton
12/30/2004 10:21:01 AM
Thanks, Bruce. I didn't know about the .Label property. That's good to
know. My only issue with .Value is some of my parameters are primary keys
and I need a good way to display the lookup values instead of the actual key
values. I was thinking I could iterate through the parameter.ValidValues
collection and display the ValidValue.Name that corresponds to the
parameter.Value that was selected. Do you know if this is possible?

Thanks,

--jason

[quoted text, click to view]
Bruce L-C [MVP]
12/30/2004 10:52:40 AM
Do you know that you can get both of the things you want without doing
anything special? Parameters!parametername.Value and
Parameters!parametername.Label Lots of people don't realize you can use
the .Label

--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Jason Burton
12/30/2004 12:33:02 PM
As always, there's more than one way to skin a cat. Great idea. Thanks for
the help!

--jason

[quoted text, click to view]
Bruce L-C [MVP]
12/30/2004 1:54:01 PM
Create another dataset that accepts the parameter as it's queryparameter.
You will end up with a single record (i.e. it has done your lookup), then
anywhere you need to use this value use this expression: =
First(Fields!fieldname.value,"DatasetName")

Note that when you create a queryparameter RS adds a report parameter. If
you have the queryparameter with the same name as the reportparameter you
already have (must match case exactly since it is case sensitive) then your
query parameter and report parameter will already be mapped correctly.

This should do exactly what you need to do.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

AddThis Social Bookmark Button