Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Footer containing data from all detail records

Status
Not open for further replies.

EddiRae

Programmer
Mar 24, 2009
2
US
Hello,
This is new territory for me with Crystal.

I have a report that I show detail lines and then at the end of the report, I need to show more information about each detail line. There is not more than 20 detail lines.

I am using the WhilePrintingRecords to set up the arrays
This is in the Report Header:
Code:
WhilePrintingRecords;
numbervar array aTrial := [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
numbervar array aFVC := [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
numbervar array aFEV1 := [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
numbervar array aPEF := [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
numbervar position :=0;
This is what is in the Group Header:
Code:
WhilePrintingRecords;
numbervar array aTrial;
numbervar array aFVC;
numbervar array aFEV1;
numbervar array aPEF;
numbervar position;

position := position + 1;

aTrial[position] := {dtRptDetail_qRFV.TRIAL};
aFVC[position] := {dtRptDetail_qRFV.FVC};
aFEV1[position] := {dtRptDetail_qRFV.FEV1};
aPEF[position] := {dtRptDetail_qRFV.PEF};

For the Report Footer, I am not sure how to this piece of the coding.

Any help would be greatly appreciated.

Thanks!!
Eddi Rae
 
I figured it out.

This is how I did it for each individual field.
In the Report Footer, I have a field for each variable. Make sure that the variable has the "Can Grow" checked.

Code:
WhilePrintingRecords;
numbervar array aTrial;
numbervar array aFVC;
numbervar array aFEV1;
numbervar array aPEF;
numbervar position;
stringvar Result := "";


for position := 1 to 20 do
(
    if aTrial[position] > 0 then
    (
        Result := Result & chr(13) & totext(aTrial[position],0);
    )
);

Result;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top