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

Sum Formula

Status
Not open for further replies.

tbpowers

MIS
Sep 10, 2008
16
0
0
US
I have a quantity field in my main report that I passed off to my subreport. In the subreport I took the quantity field and placed it in a formula ({@Valuation Material Costs}*{@Qty from Main Report}). This is placed in the Group Header. Now I want to setup a grand total of this formula but I can not figure out how to get there. Any ideas?
 
The grand total is in the subreport? You can use a variable to sum your formula (place this in the same section as your formula):

whileprintingrecords;
numbervar sumx := sumx + {@yourformula};

Then in the sub footer, use:
whileprintingrecords;
numbervar sumx;

-LB
 
I tried the "WhilePrintingRecords" in the subreport, but the way I have it setup it wouldn't work. I tried passing the formula back to the main report and then setup the "WhilePrintingRecords" formulas and it almost works. For some reason my top record is 0.00 and it leaves off my last record amount. It's like it is shifted off one line. I'll keep playing around with it. Thanks.
 
Make sure your formula in the main report is in a section BELOW the subreport. If it is in the same section as the subreport it will happen before the subreport is run, and you will be off by one.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top