0

我有一個主報告和大量子報告的晶體xi報告。將一個多值參數連接到子報告中

我已將所有子報告鏈接到2個參數,對於單個標準匹配非常適用,但是現在我需要能夠爲其中一個參數設置多個標準,但它只是不會'將細節傳遞給子報表。

這是我目前在我的主報告中記錄選擇

{Communication.Comm_Status} = "Complete" and 
isnull ({Communication.Comm_Deleted}) and 
{Communication.Comm_Action} = "PhoneOut" and 
{Communication.comm_Result} in ["0", "1", "2"] and 
not ({Communication.Comm_UpdatedBy} in [30, 33, 59]) and 
{Communication.Comm_DateTime} in LastFullWeek and 
{Territories.Terr_Caption} = {?Client} and 
{Company.comp_campaign} = {?Campaign} 

,這就是我在我的子報表記錄選擇

isnull ({Communication.Comm_Deleted}) and 
{Communication.Comm_Status} = "Complete" and 
{Territories.Terr_Caption} = {?Pm-Territories.Terr_Caption} and 
{Territories.Terr_Caption} = {?Pm-Territories.Terr_Caption} and 
{Communication.comm_Result} in ["0", "1", "2", "3", "4"] and 
not ({Communication.Comm_UpdatedBy} in [30, 33, 59]) and 
{Communication.Comm_DateTime} in LastFullWeek and 
{Company.comp_campaign} = {?Pm-Company.comp_campaign} 

我想我會非常喜歡的「 ='參數1和'包含'在參數2

我試圖搜索的決議,但我不知道我應該尋找什麼條件加入;多值參數還是別的?

先感謝您的任何指導。

回答

0

我不是在你的例子很確定這放慢參數是哪個,但你可以這樣做:

({tableName.tableField} = {?parameter1} AND 
InStr({tableName.tableField}, {?parameter2}) > 0) 

這將確保您的域等於參數1和參數2包含在該領域。如果它是不同的數據類型,則可能需要將字段轉換爲字符串。

編輯:

對不起,我想我已經沒有付出100%注意的問題。如果你有一個多值參數,那麼你必須把它看作一個數組(這就是爲什麼你用我的原始公式得到錯誤)。在通過陣列以循環,你需要創建一個公式,像這樣:

WhilePrintingRecords; 
numbervar x := 1; 
numbervar y := 0; 

while x <= ubound({?Campaign}) 

do 
(if instr({Company.comp_campaign},{?Campaign}[x],1) > 0 
then y := y + 1; 
x := x + 1); 

y 

編輯:

WhilePrintingRecords; 
stringvar array campaign := {?Campaign}; 
numbervar x := 1; 
numbervar y := 0; 

for x := 1 to ubound(campaign) 
do 
(if instr({Company.comp_campaign},{?Campaign}[x],1) > 0 
then y := y + 1; 
x := x + 1); 
y 

然後在您的記錄選擇您需要檢查公式> 0

+0

嗨!感謝這,它可以工作 我加入如上,並得到'這個數組必須下標。例如:Array [i]' 任何想法? – crystalXIuser

+0

你能發表完整的聲明嗎?在[「0」,「1」,「2」中爲 –

+0

{Communication.Comm_Status} =「完成」和 isnull({Communication.Comm_Deleted})和 {Communication.Comm_Action} =「PhoneOut」和 {Communication.comm_Result} 「]和 不({Communication.Comm_UpdatedBy}在[30,33,59])和 {Communication.Comm_DateTime}在LastFullWeek和 ({Territories.Terr_Caption} = {?客戶端} AND InStr函數({公司。 {?Campaign})> 0) 當錯誤顯示它突出顯示{?Campaign} – crystalXIuser

相關問題