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!

Calculate with summary fields in break footer.

Status
Not open for further replies.

lglobe

Programmer
Jul 29, 2011
9
0
0
NL
How can I Calculate with summary fields in break footer, and place it in the same Footer.
Footer display's the total number of product and the total amount of the product.
And I want to display the average price by dividing those two.
The price for each product per record is different.

Clarion 6.3/7/8

Regards leo
 
Hi Leo,

IIRC, Clarion 7 introduced the AVE attribute for that. Also, check on SUM in the help as using SUM(LocalVar) ensures that the LocalVar contains the value.

Regards
 
Hi Leo,

The reason the average is failing is because of the NEGATIVE qty & amount.

You could define some local variables ::

TOT:product DECIMAL(13,2)
TOT:Amount DECIMAL(13,2)
TOT:Average DECIMAL(13,2)

In the total detail band, make sure you use the SUM(TOT:product) & SUM(TOT:Amount) for the totals of Product & amount. And, after every detail printing do a TOT:Average = TOT:Amount / TOT:product.
Assuming that the TOT:product & TOT:Amount contains the running totals after every detail printing, the TOT:Average will be calculated correctly.

Regards
 
Hoi ShankarJ,

When I use both of the embeddpoints ther result is the same.
the TOT:Average is calculated after printing the footer.

That's where I stucked before opening this Thread.
Am I missing the right embeddpoint?

Regards Leo
 
 http://www.mediafire.com/i/?gd6q6i8bvsx7f2y
Hi Leo,

The best way to find the correct embed is to go to Source mode in the Embeds and find the first embed after PRINT(RPT:Detail).

If that does not work, than I suggest you convert your HEADER/FOOTER bands into DETAIL bands and use the Report Properties -> Breaks section to configure your breaks. You may need to define some local variables to hold the totals but this gives you more flexibility.

Regards
 
Hi ShankarJ,

Didn't find a embed to make it work.
Converting Header/Footer bands into Detail is new for me.
I'll think about later when I didn't get thinks working.

My solution for this moment: See attachment.

Thanks for getting me in the position to find a solution.
If you have another suggestions they are welcome.

Regards Leo

 
 http://www.mediafire.com/i/?q5s6gp84fq69e1p
Hi Leo,

What you have done will work i.e. add to the totals & calculate the average before the detail printing.

I never use the automatic BREAKs and always hand code my breaks since it gives me better control.

Regards
 
Hi!

Forgot to add, the BIGGEST limitation of the Clarion report engine is that it generates NO events before & after a break/page.

Regards

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top