[{"id":"840f0737-df1d-47ae-bb0a-359b01fe0608","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"d5d9cdef-8854-4505-89be-a2bbc3cb4482","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"3dc3dd55-35b0-4d23-bf62-47bc3650e4ee","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"80d84fbc-d0f8-4e4a-947f-e3e4de9b49b2","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"9152b7ca-0186-4fe3-a26f-5a05f322db07","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]}]
        
(Showing Draft Content)

IsNothing函数示例

IsNothing 函数用于判断一个参数是否是一个空引用指针对象。

比如,我们可以使用 IsNothing 函数来判断报表是否有参数值输入,然后配合IIF函数来实现如下效果:

  • 如果未输入参数,报表内容则显示“未输入参数值”

  • 如果输入了参数,报表内容则显示出参数的值。

操作示例

1. 新建报表,并为报表定义一个可忽略的参数p1。

image2020-6-10_12-24-42.png


2. 在报表中添加一个文本框组件,并为文本框内添加表达式 {IIF(IsNothing(@p1), "未输入参数值", @p1)}。

image2020-10-13_14-15-16.png


3. 预览报表,查看效果。默认不需要输入参数,报表内容呈现“ 未输入参数值 ”;当输入参数值时,报表内容呈现参数的数值。

image2020-6-10_12-26-27.png

image2020-6-10_12-27-29.png