确定Crystal Reports页面是否包含字符串

时间:2012-11-06 21:35:54

标签: crystal-reports

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

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

1 个答案:

答案 0 :(得分: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";
相关问题