Global Variables can't be set in subreports?
I am having a problem getting a variable from the subreport to a main
report.
I have tried setting a global variable, but it always resets to 0 back in
the main report. I've even tried changing the values of certain objects in
the main report and no luck.
It seems everything I do in the subreport is kept locally inside of it.
The code to set the variables is on the OnCalc, as I have the subreport set
as Not Visible.
report.
I have tried setting a global variable, but it always resets to 0 back in
the main report. I've even tried changing the values of certain objects in
the main report and no luck.
It seems everything I do in the subreport is kept locally inside of it.
The code to set the variables is on the OnCalc, as I have the subreport set
as Not Visible.
This discussion has been closed.
Comments
You need to declair the global variable in the Variables declairation
section of the Module View in RAP. Then assign it to another variable in
the GlobalCreate. Finally in the OnCalc of the variable in the subreport
you can use the global variable to access the variable in the main report.
See the following example.
http://www.digital-metaphors.com/tips/TotalsFromSubreportWithRAP.zip
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com