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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal 9-Subtotaling a SUBreport to show in MAIN rpt

Status
Not open for further replies.

OrionStar

Technical User
Dec 3, 2004
336
0
0
US
Dear Forum:

I have a subreport entered into a report. I have a subtotal for my main report, and I now need my subreport to have a subtotal and have it show in the main reports report footer. OR at end of the report with my OTHER MAIN subtotal..

How can I achieve this please?

Thank you
Mike

"A man is only as happy,... as he makes up his mind to be...
 
You should really provide your group structure and the location of your subreport. Let me guess that you have a subreport in a group header or footer. In the subreport create a shared variable that is set to your sum in the subreport, e.g.,

whileprintingrecords;
shared numbervar sumsub := sum({table.amt});

You must place this on your subreport canvas. Then in the main report, in a section below the one in which your subreport is located, e.g., if your subreport is in GH#1_a, then you would add the following formula to GH#1_b:

whileprintingrecords;
shared numbervar sumsub;
numbervar totsumsub := totsumsub + sumsub;

Then in the report footer, you would would reference the result by using:

whileprintingrecords;
numbervar totsumsub;

If you have any null values for sumsub, then you need to also add a reset formula:

whileprintingrecords;
shared numbervar sumsub := 0;

This would be placed in a main report section either before the subreport section or in a section below the one in the main report where the shared variable formula is located.

-LB
 
I have following as a structure.
SUBREPORT
MATTER# DATE FEEAMOUNT MATTER# DATE COSTAMOUNT

6825 01/04 500.00 6825 01/01 400.00

TOTAL 500.00

I hope this helps. I need the subreport's 400.00 column to have a grand total in the MAIN reports report footer.

Also, my subreport is in the DETAILS section fo the main report and linked by MATTER number.
Thanks

"A man is only as happy,... as he makes up his mind to be...
 
I did exactly what you suggested...and IT WORKED>...Thanks

Mike

"A man is only as happy,... as he makes up his mind to be...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top