0

我在水晶报表中有一个公式字段,如下所示

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";

我将此公式字段的输出作为“百分比强度”,但是当我声明另一个公式字段时,如下所示

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

我对这个领域没有任何兴趣。

根据我已将其定义为 gloabl 数组,我们需要将第二个公式字段值的值作为“百分比强度”。

如何在另一个公式字段中获取数组值?

4

1 回答 1

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];
于 2012-04-30T12:35:22.197 回答