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

SUM in the group header

Status
Not open for further replies.

ketankshah

IS-IT--Management
Jan 11, 2001
121
IN
I am using quick reports in Delphi 5. In a report I want to calculate the share of value of each row. For that I need the sum of a particular group. I am getting the sum in the group footer. But for calculation how can I get the sum at each row. This is case of forward reference.

e.g.

The report is something like this.

Product Sales Share
------- ----- -----
AAA 700 70% (Share is calc. as 700/1000*100)
BBB 200 20%
CCC 100 10%
----
Total 1000

Ketan
 
ketankshah,

I'd probably do this by calculating the totals before running the report. If you save the results in a detail table containing the linking values of the records in your record band, you can get your results as a simple master-detail report.

Alternatively, you can create calculated feilds objects and calculate those before your print the report. Do the actual calculations either in the OnCalculate event of your dataset or in the BeforePrint event of your detaqil band.

I've used both approaches; one works well for some circumstances and the other works for different ones. Do a simple experiment to see which is best for your situation.

hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top