2012-04-30 35 views
0

我有如下價值Crystal報表不顯示在字符串數組

global numberVar detailLine ; 
global stringVar array SummaryArun ; 
WhilePrintingRecords ; 
Redim Preserve SummaryArun [3] ; 

SummaryArun[1] :="Litres Of Liquid"; 
SummaryArun[2] :="Litres Of Alcohol"; 
SummaryArun[3] := "Percentage Strength";

我得到這個公式域的輸出爲「百分比力量」,但是當我宣佈另一鑑於Crystal報表中一個公式域公式字段,如下所示

global stringVar array SummaryArun ; 
Redim Preserve SummaryArun [3] ; 
SummaryArun[3];

我沒有得到任何的這個字段。

根據我已經把它作爲gloabl數組,我們需要獲得第二個公式字段值的值作爲「百分比強度」。

如何獲得另一個公式字段中的數組值?

回答

0

更改您的第一個公式:

//{@formula_one} 

// unless you are using this formula in the second pass (i.e. with summary fields) 
// whileprintingrecords is unnecessary; it should always be the first entry if you are going 
// to use it 
WhilePrintingRecords ; 

global numberVar detailLine ; 

global stringVar array SummaryArun ; 
// you don't need to add the Preserve option unless you are trying to keep existing values 
// this doesn't appear to be the case here 
Redim SummaryArun [3] ; 

SummaryArun[1] := "Litres Of Liquid"; 
SummaryArun[2] := "Litres Of Alcohol"; 
SummaryArun[3] := "Percentage Strength"; 

改變你的第二個公式:

//{@Percentage Strength} 

// if you are declaring your array WhilePrintingRecords (as you have done in the other formula) 
// then you will need to do so when you *use* the variable 
WhilePrintingRecords; 

global stringVar array SummaryArun; 

// you aren't changing the size of the array, so this line isn't necessary 
//Redim Preserve SummaryArun [3] ; 

SummaryArun[3]; 
相關問題