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

Totals in subreports and variable reset

edited August 2003 in RAP
Hi,

Using:
-------
Delphi 5, RB Enterprise 6.03

Description:
--------
We have master pipeline and a linked detail pipeline (1--0..n). The
master pipeline is linked to the main report, the detail pipeline is
linked to a subreport that is placed in the detail band of the main
report. We can only use RAP to calculate values.

Problem:
---------
We need to obtain the sum of a calculated value and display this in the
summary band of the detail report.
I have added a variable declaration in the subreport called
TotalWords : Integer

In a TppVariable in the detail band of the subreport I calculate a value
in the OnCalc event
eg
WordsEarned := ;
PointsEarned := ;
TotalWords := TotalWords + WordsEarned;
Value := PointsEarned

Another TppVariable placed in the summary banned has the following code
in the OnCalc event
Value := TotalWords


The problem is which event to use to set TotalWords to 0 (zero) again to
obtain the correct outcome. The value TotalWords needs to be reset every
time the master goes to the next record.
We have tried lots of possibilities but none really seem to work.

Furthermore the user can cange the settings from onepass to twopass or
back if they want this. Also we can't change versions of RB at the
moment, it is a legacy application.


Any ideas/suggestions are welcome
regards
Paul Sjoerdsma

Comments

This discussion has been closed.