Keeptogether and group total on 2 pages
I have a reasonably complex report with several subreports and a
running total over all subreports.
The total is done via an invisible DBCalc (oncalc) variable
incremented in detail section of the subreports and put into a
TppVariable.
The subreports have property "Keeptogether".
It works fine as long as the report fits on one page.
When one of the subreport get split in 2 the end total is wrong.
The last item of the subreport on page one gets counted twice, once on
page one and once on page 2.
When I remove all the Keeptogether (to all the groups and subreports)
then it works.
I don't think this is normaal?
Is there a way to make this works?
Thankx
This discussion has been closed.
Comments
Which version of ReportBuilder and Delphi are you currently using? When
making calculations, I would recommend exclusively using TppVariable
components rather than DBCalcs. DBCalc components are designed to function
as is.
Try placing a single TppVariable in the group footer and have it calculate
on Traversal. Then in the OnCalc event, calculate the group total in code.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Sorry for the mistake in my original post, I see that the variable is
not a DBCalc but a normal variable, just there to "build" the total.
I have in this case 3 subrapports.
Each has an invisible variable in de detail section where the oncalc
updates the Totaal (TppVariable) that is displayed in the footer of
the main page.
The code of the oncalc is a simple tppvariable.value :=
tppvaraible.value + "currentvalue".
The Tppvariable is declared in the main tab of the rapport.
I am not sure I see another way of calculating the totaal that would
not count a record too much when the subrapport is split on 2 pages...
I have other examples where I only have groups, no subrapports, and I
get the same problem unless I turn off all the "keeptogether"...
Chantal
On Thu, 13 Sep 2007 08:28:43 -0600, "Nico Cizik \(Digital Metaphors\)"
My first suggestion would be to download and install a trial edition of RB
10.06 and test with that. We have gradually been making changes to the
TppVariable to handle the limitation of calculating a page total with a
dynamic detail band. If you still see the problem, try to put together a
small example that demonstrates this behavior that we can run on our
machines and send it in .zip format to support@digital-metaphors.com.
Are you trying to keep a running total in the page footer or a total for the
given page? If this is a page total, be sure you have your variables (in
the page footer) set to reset on PageEnd. This will ensure proper reset
timing.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com