Sub-Report, Groups, two data pipelines, how do I do Totals?
Hi I wasn't sure which newsgroup to post this in. I have a master and a
detail query for a report. The main report is grouped on Master fields. But
the detail data goes into a sub-report, which is in the header of the lowest
of 4 groups. But the totals are for the detail records within the
sub-report, are in the footers of the main report groups, and of course do
not work. How can I setup such a report? It came from an earlier
reportbuilder version which allowed the seperate master and detail
pipelines.
Thank,
Steve
detail query for a report. The main report is grouped on Master fields. But
the detail data goes into a sub-report, which is in the header of the lowest
of 4 groups. But the totals are for the detail records within the
sub-report, are in the footers of the main report groups, and of course do
not work. How can I setup such a report? It came from an earlier
reportbuilder version which allowed the seperate master and detail
pipelines.
Thank,
Steve
This discussion has been closed.
Comments
First, let me restate the issue to see whether I understand...
You have a master/detail data relationship. The main report has four groups.
The groupheader of the inner most group contains a subreport. The
groupfooter of the inner most group contains totals for the detail records
printed by the subreport.
Okay now for a proposed solution...
In the groupfooter use one TppVariable component for each Total. Configure
the Timing to reset the totals on group end. Access the child report
workspace and add a dummy TppVariable component to the detail band. Set the
Visible property to false. Use the dummy variable OnCalc event to accumulate
the group totals:
procedure DummyVariableOnCalc(Sender: TObject; Value: Variant);
begin
myGroupVariable1.Value := myGroupVariable1.Value +
myDetailPipeline['myDataField1'];
end;
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Steve