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

Calculating sum of a variable in a group header

edited January 2002 in General
Hi,

I have a report with these fields in the detail band:

Employee
Work Hours
Vacation Hours
Holiday Hours

In my group header for each employee, I have used TppdbCalcs to sum up Work
Hours, Vacation Hours, and Holiday Hours, with Lookahead = true.

I also need to display the sum of these three TppdbCalcs in the Employee
group header.

I tried to create a TppVariable and add together Sum(Work hours) +
Sum(Vacation Hours) + Sum(Holiday Hours), but I could not make this work.
Should it work? How do I do it?

Next I created a TppVariable in the detail band to calculate Work Hours +
Vacation Hours + Holiday Hours. I tried to create a TdbCalc in my group
header which would sum up this variable but I could not. Should this work?

Should I be creating variables to calculate the sums instead of using
DBCalcs? How do I calculate a sum using a TppVariable?

Thank you very much.

Alexandra Saur

Comments

  • edited January 2002
    When each detail band generates, a record is traversed in the datapipeline.
    If a DBCalc is in the group header band, then a draw text command is added
    to the output page when the group header generates. Since, the group header
    has already generated, then a LookAhead DBCalc will have to have it's draw
    command value text updated. The DBCalc's OnCalc fires everytime the detail
    record is traversed, and causes the value text to be updated. The best
    solution is to create a calculated field in a lookup query which provides
    the calculated values for each group, in the group header.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.