1

我有一个报告,其中有一个可选的字符串参数。这是水晶报表 XI (11.0.0)。在报告中,我想在报告运行时显示“全部”,参数留空。我尝试了以下方法:我右键单击该字段 -> 格式字段 -> 通用 -> 显示字符串

if {?Location} = '' then 'all'
if IsNull({?Location}) then 'All'
if Length({?Location})< 1 then 'All'
if Length(Trim({?Location}))< 1 then 'All'


ToText(Length({?Location}))
当我放置或时也没有打印任何内容
ToText(IsNull({?Location}))

与此问题相关的还有 如何处理 Crystal Reports 中的空数字字段/变量?
在本次提交时没有接受的答案。我的谷歌搜索没有发现任何有价值的东西。

4

1 回答 1

0

不要使用 Display String 属性,而是创建一个公式:

If IsNull({?Location}) Or Trim({?Location}) = "" Then
    "All"
Else
    {?Location}

现在将您的@Formula 放入报告中。

于 2014-11-21T02:42:53.923 回答