开发者

RDL is it possible to have optional parameter or force default value to null

开发者 https://www.devze.com 2023-01-06 10:56 出处:网络
I need to have an optional parameter or a parameter that\'s default value is null. I want to use a dropdown list for a report, the list is getting it\'s values from another dataset. I have selected

I need to have an optional parameter or a parameter that's default value is null.

I want to use a dropdown list for a report, the list is getting it's values from another dataset. I have selected the option to allow NULL values. I have tried setting the default value to null and all the other settings available. Is there some way to make this dropdown optional or have the default value as NULL?

I've searched and found this question that was asked and comes close but does not answer the optional/null question...In the query for the report I am making sure th开发者_运维技巧e value is either NULL or not: SQL Server Reporting Services - Set default value for multi-value report parameter

(@assignedTo is null or @assignedTo = [User].UserInfo.FirstName +' '+ [User].UserInfo.LastName) 


Did you try this for your dataset query:

SELECT userName as Label, userId as Value FROM dbo.users UNION ALL SELECT 'All Users', NULL

Then add a default value set to null

This should work. for reuse, I often encapsulate this pattern with an inline udf


Since I can't seem to do what I want (and no one gave ANY advice), setting the first value in the dropdown to NULL..I've come up with a better solution, hopefully.

I'm going to create a class that creates the dataset and adds the NULL value to the collection. Then add that collection to the report..I hope this will work. This way it's great for reusability..etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号