繁体   English   中英

在Crystal Reports 2008中在公式字段中合并文本

[英]Combine text in formula field in crystal reports 2008

我有databasefields检查条件并返回多行文本。 例如:

returnText =''

  If TD1 = true then returnText = 'text1' If TD2 = true then returnText = returnText + \\n' + 'text2' If TD3 = true then returnText = returnText + \\n' + 'text3' return returnText 

如何使用公式字段执行此操作,或者执行此操作的另一种方法是什么?

您可以使用公式来完成。 不知道您使用什么语法。 它更接近Basic,但是这里是Crystal语法版本:

local stringVar returnText = "";

if TD1 = true then
    returnText := "text1";
if TD2 = true then
    returnText := returnText + chr(13) + "text2";
If TD3 = true then
    returnText := returnText + chr(13) + "text3";
returnText

或使用Basic:

dim returnText as string
returnText = ""

if TD1 = true then
    returnText = "text1"
end if
if TD2 = true then
    returnText = returnText + chr(13) + "text2"
end if
If TD3 = true then
    returnText = returnText + chr(13) + "text3"
end if
formula = returnText

暂无
暂无

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

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