Groups | Blog | Home
all groups > sql server reporting services > march 2005 >

sql server reporting services : PROBLEM- Use parameter to populate field in headerpage


Bach
3/7/2005 5:21:02 PM
Hi all,

I use hidden report parameters to populate textboxes in the pageheader and
come across this problem.
When the query for the default value for a parameter returns no rows, I get
an error "Parameter validation failed. It is not possible to provide valid
values for all parameters. (rsParameterError)".
This error is expected in this case. My question is is there a way to get
around this?
Chris McGuigan
3/8/2005 1:53:09 AM
In the query for the parameters dataset, force a record to be returned.
Union is a good function for this. I.e.,
Select Name From Table1 Where Type = 'whatever'
UNION
Select '(blank)'

Or you could do
If Exists(Select * From Table1 Where Type = 'whatever')
Select Name From Table1 Where Type = 'whatever'
Else
Select '(blank)' As Name

First option is more efficient but may have side effects for you.

Chris

[quoted text, click to view]
AddThis Social Bookmark Button