Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Group Calc Timing

edited March 2002 in General
I am having difficulty with a simple report with 3 levels of grouping,
populated by an Interbase Query, hooked up to a DB pipeline.

Group totals are fine, simply using a DBCalc, but I need to show what
percentage of the total each record represents. I have a ppVariable which
does the calculation in an OnCalc event, but the percentage only calculates
on a cummulative basis, so the first record is always 100%. I am using two
pass, with look ahead on the DBCalc SUM field.
Delphi 5 RB 5.6 Interbase 6

Any ideas?

Will

Comments

  • edited March 2002
    You'll need to create a list of group totals in the first pass. Then in the
    second pass, calculate the percentages by pulling the total value from the
    list. There are two boolean properties which will help you determine when
    to perform the calculations in the OnCalc event handler code:
    Report.FirstPass and Report.SecondPass.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.