Problem with default values for Reporting Services parameters

Problem with default values for Reporting Services parameters

躲猫猫 发布于 2021-11-28 字数 716 浏览 765 回复 3 原文

I have a SQL 2005 Reporting Services report that has several report parameters. One of them is called IsActive and is of type Boolean. The parameter is hidden and set to allow null values. For its default values settings, I have it set to null. In my application that has the reportviewer control, I have logic that decided whether or not to set this parameter to a value (true or false). There are conditions that require it to be not set at all. For some reason, if I do not pass a value, the parameter defaults to TRUE. It operates fine when a value is passed. Is my problem stemming from the simple reason that it is a Boolean parameter? Would changing it to a string be better?


如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。



需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。


溺深海 2022-06-07 3 楼

IIf(IsNothing(Fields!BooleanField.Value) , "-- Any --" , IIf(Fields!BooleanField.Value = True , "Yes" , "No"))

π浅易 2022-06-07 2 楼

Don't know if this is related...

I had a problem where I could not get the default value to be selected when viewing the report from outside of the BIDS after making changes to the report.

It turned out that the parameter settings was not updated when deploying the report.

Changing the settings manually via the Report Manager or removing and re-deploying the report solved the problem.

情仇皆在手 2022-06-07 1 楼

Changing it to a string is only necessary if there's no way to get it to take the NULL value because of a bug or "feature".