Subreport totals on summary band on main report error
Hi
I'm using RB 17.03. I have a master detail report. Main report contains
master datasource and the subreport contains detail datasource. The
subreport has a summary band with a total and so on with every master
record.
I need to show a summary band in the main report with the total adding
of every subtotal, on the summary band of the subreport.
I put a DBCalc variable in the summary band of the subreport with the
total of a record field and on the OnCalc event of this variable, I set
the value of a global variable (for example gTotal := DBCalc1.Value).
Then in the summary band of the main report I have a variable of type
Double and on its OnCalc event I add to its value the gTotal value
(myGrandTotal.Value := myGrandTotal.Value + gTotal).
It works fine except that the last total value in the subreport, is not
contained on this grand total but if after previewing it, I print to PDF
for example, then it calculates correctly and the last subtotal value is
included on the grand total. If the whole report needs only one page it
works ok but if the whole report needs more than one page I have the
problem mentioned
How do I solve this issue? I show an example of the problem. I hope it's
understandable
Main record 1
subreport record value 1
subreport record value 2
subreport record value 3
-------------------------
Subreport summary total (1 + 2 + 3) = A
Main record 2
subreport record value 1
subreport record value 2
subreport record value 3
-------------------------
Subreprot summary total (1 + 2 + 3) = B
Main record 3
subreport record value 1
subreport record value 2
subreport record value 3
-------------------------
Subreprot summary total (1 + 2 + 3) = C
Previewing shows grand Total main report only adding A + B. Then if I
print to PDF or Excel Grand Total adds A + B + C
Thanks
---
El software de antivirus Avast ha analizado este correo electr?nico en busca de virus.
https://www.avast.com/antivirus
I'm using RB 17.03. I have a master detail report. Main report contains
master datasource and the subreport contains detail datasource. The
subreport has a summary band with a total and so on with every master
record.
I need to show a summary band in the main report with the total adding
of every subtotal, on the summary band of the subreport.
I put a DBCalc variable in the summary band of the subreport with the
total of a record field and on the OnCalc event of this variable, I set
the value of a global variable (for example gTotal := DBCalc1.Value).
Then in the summary band of the main report I have a variable of type
Double and on its OnCalc event I add to its value the gTotal value
(myGrandTotal.Value := myGrandTotal.Value + gTotal).
It works fine except that the last total value in the subreport, is not
contained on this grand total but if after previewing it, I print to PDF
for example, then it calculates correctly and the last subtotal value is
included on the grand total. If the whole report needs only one page it
works ok but if the whole report needs more than one page I have the
problem mentioned
How do I solve this issue? I show an example of the problem. I hope it's
understandable
Main record 1
subreport record value 1
subreport record value 2
subreport record value 3
-------------------------
Subreport summary total (1 + 2 + 3) = A
Main record 2
subreport record value 1
subreport record value 2
subreport record value 3
-------------------------
Subreprot summary total (1 + 2 + 3) = B
Main record 3
subreport record value 1
subreport record value 2
subreport record value 3
-------------------------
Subreprot summary total (1 + 2 + 3) = C
Previewing shows grand Total main report only adding A + B. Then if I
print to PDF or Excel Grand Total adds A + B + C
Thanks
---
El software de antivirus Avast ha analizado este correo electr?nico en busca de virus.
https://www.avast.com/antivirus
This discussion has been closed.
Comments
In my testing with RB 18.0 the example located in the following
article/example, I was unable to recreate this behavior. The example
however keeps a running total in the main report rather than adding the
subreport totals. You might want to try this.
http://www.digital-metaphors.com/rbWiki/RAP/Calculations/How_To...Access_Subreport_Values_in_the_Main_Report
Perhaps you can download and alter this example or create your own
simple example I can run here so we can see the problem and find a solution.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I didn't know that. It works perfect!!! and it's very usefull
Thanks a lot
El 14/02/2017 a las 14:40 p.m., Nico Cizik (Digital Metaphors) escribi?:
---
El software de antivirus Avast ha analizado este correo electr?nico en busca de virus.
https://www.avast.com/antivirus