In my report I have a dataset that is returning an ID field among other things. I am setting a hidden parameter = to that ID field. That parameter is then used to return another dataset.
My problem is that the original dataset with the ID field does not always bring back data (this is expected). If data is not brought back, I get an error when I try to execute the report ("The 'X' parameter is missing a value").
I have the parameter set to "Allow Null Values".
This value is not required in the SQL Server stored procedure that returns values for the new dataset.
The parameter is of type Integer. (So I am not able to set the "Allow Blank Value" property)
This is NOT a multi-value parameter.
Does anyone have any suggestions/ideas/workarounds to solve my problem?
Could you add a UNION to your first dataset to also return a record full of NULL values?Would this mess with the rest of your report?
Something like:
SELECT
Id, Description
FROM X
UNION
SELECT
Null, Null
That way your dataset will always return a value even if there is no data in table X.
|||
That may work, the other option with SQL would be for me to use IF EXISTS
IF EXISTS (select ID, Desc) THEN
select ID, Desc
ELSE
Select null, null
I am more interested in why reporting services gives me that error when I am allowing null values. I suspect it has something to do with trying to assign the parameter value from an empty dataset.
No comments:
Post a Comment