1

是否可以检查 Crystal Reports 中的页面是否包含特定字符串?

例如,我想在所有页面中搜索“今天”这个词,如果在页面上找到,则在页脚上显示一个“找到文本”的注释。

4

1 回答 1

3

将此公式添加到页眉部分,然后取消它:

// {@reset}
// reset arrays
WhilePrintingRecords;
Booleanvar found:=false;

将此公式添加到详细信息部分,然后将其隐藏;

// {@test}

WhilePrintingRecords;
Booleanvar found;

if Instr({table.field},"Today") > 0 Then found:=true;

将此公式添加到页脚部分:

// {@display}
// display the text that was found

WhilePrintingRecords;
Booleanvar found;

if found then "Text found";
于 2012-11-07T14:01:17.873 回答