Variable on the first page takes into account the first record from the second page
Hello,
Delphi 7
RB 14.04
In a master-detail (an invoice) with the subreport (the lines of the
invoice) spreading across multiple pages, I need some variables to make
counts and sums from subreport and to print on each page (total and number
of items on page). I put these variables on the footer of the main report
and set the timing Calculate On "DataPipelineTraversal" and the
datapipeline set to the subreport's data and Reset On "Page Start".
On first page the variables take into account the first record from the
second page, but after that, work ok; I've tried changing the timing
settings (On Page End) without success.
Any idea how to bypass the issue?
Thank you,
RB
--
Using Opera's mail client: http://www.opera.com/mail/
Delphi 7
RB 14.04
In a master-detail (an invoice) with the subreport (the lines of the
invoice) spreading across multiple pages, I need some variables to make
counts and sums from subreport and to print on each page (total and number
of items on page). I put these variables on the footer of the main report
and set the timing Calculate On "DataPipelineTraversal" and the
datapipeline set to the subreport's data and Reset On "Page Start".
On first page the variables take into account the first record from the
second page, but after that, work ok; I've tried changing the timing
settings (On Page End) without success.
Any idea how to bypass the issue?
Thank you,
RB
--
Using Opera's mail client: http://www.opera.com/mail/
This discussion has been closed.
Comments
When working with TppVariables, be sure of the following items.
1. All calculations need to be made inside the OnCalc event of the
variable. This is necessary to ensure the calculations are made only
once per traversal.
2. If you are making numeric calculations, be sure the TppVariable
datatype is set to a numeric type (not String).
See the following articles for more information on using TppVariables
for calculations inside reports.
http://www.digital-metaphors.com/rbWiki/Delphi_Code/Calculations/Overview
http://www.digital-metaphors.com/rbWiki/Delphi_Code/Calculations/How_To...Display_Subreport_Totals_in_the_Main_Report
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
It gave me a better idea to solve the problem.
I put the footer on the subreport and there I put the variables for the
partial sums and counts.
Then I suppress printing the footer on the last page and it works
perfectly.
The grand totals remain on the summary band of the subreport.
On Tue, 07 May 2013 16:12:47 +0300, Nico Cizik (Digital Metaphors)
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com