2012-11-06 18 views
1

是否可以檢查Crystal Reports中的頁面是否包含特定的字符串?例如,我想搜索單詞「Today」的所有頁面,如果在頁面上找到,則在頁面頁腳上顯示Note reading「Text Found」。確定Crystal Reports頁面是否包含字符串

+0

在某一個領域或在網頁上的所有字段? – Ryan

回答

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"; 
相關問題