Overall totals of subreports
I have a Master Detail report. The master tables data is on the main page
of the report. The detail query's data is on the subreport. I have a
summary section on both reports. The summaries are simply DBCalc sum(field)
on both pages.
The summary sections of the details look fine. But the overall summary on
the main report is only summing the first record of each subreport. Can you
tell me what is wrong?
Delphi 5 pro, RB 5.56.
--
Don Gollahon
(gollahon@geneseo.net)
of the report. The detail query's data is on the subreport. I have a
summary section on both reports. The summaries are simply DBCalc sum(field)
on both pages.
The summary sections of the details look fine. But the overall summary on
the main report is only summing the first record of each subreport. Can you
tell me what is wrong?
Delphi 5 pro, RB 5.56.
--
Don Gollahon
(gollahon@geneseo.net)
This discussion has been closed.
Comments
getting the values based on the traversal of the master data pipeline. Try
connecting it to the detail datapipeline.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
The DBCalc has to come from the detail datapipeline because that is the only
place these fields are. I have the dbcalc fields in the summary area of the
main report to get the sum of all the detail amounts for all detail reords.
What I get is only the sum of the first detail record attached to each
master record.
--
Don Gollahon
(gollahon@geneseo.net)
DBCalc is in the main report. To work around this problem, perform the
calculation sum in each subreport with a variable and use a variable in the
summary band of the main report to sum the values from these subreports.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
the subreport.
procedure TForm1.vblDetailValueCalc(Sender: TObject; var Value: Variant);
begin
{increment the detail band running total with the main report variable}
vblMainTotal.Value := vblMainTotal.Value + 1;
{display the total in the summary band as well}
vblSummaryTotal.Value := vblMainTotal.Value;
{display the new total}
Value := vblMainTotal.Value;
end;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
switch to your method later because that way if the detail query changes in
some way then I don't have to remember to change the sum query as well.
Thanks.
--
Don Gollahon
(gollahon@geneseo.net)