简体   繁体   English

水晶报表:If语句

[英]Crystal Reports: If statement

I have below code in the Crystal Reports. 我在Crystal Reports中有以下代码。 The report is supposed to show the item description when the description is not null, but when the size is null. 如果描述不为null,但大小为null,则报告应显示项目描述。 The report is not showing anything when the description is not null, but the size is null. 如果描述不为null,但大小为null,则报告将不显示任何内容。 The code looks all right, but what am I missing? 该代码看起来还不错,但是我缺少什么呢?

if ({Command.size})='None' then {Command.Description} 如果({Command.size})='None',则{Command.Description}

else if not isnull({Command.Description}) and not isnull ({Command.size}) then {Command.Description}+ ' ' +{Command.size} 否则,如果不是非null({Command.Description})和非非null({Command.size}),则{Command.Description} +''+ {Command.size}

else if isnull ({Command.size}) and not isnull ({Command.Description}) then {Command.Description} 否则,如果是非null({Command.size}),而不是非null({Command.Description}),则{Command.Description}

else if isnull ({Command.Description}) and not isnull ({Command.size}) then {Command.size} 否则,如果为null({Command.Description})而不是null({Command.size}),则为{Command.size}

Check for nulls first. 首先检查空值。 Otherwise, Crystal would choke on the null objects encountered before. 否则,Crystal会阻塞之前遇到的空对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM