Varible Calculations In Subreport
I do I perform a variable calculation in a main report using the value of a
variable in a subreport?
I have tried the following but get errors:
Variable1.AsDouble :=SubReport1['vSub'].AsDouble;
Variable1.AsDouble :=SubReport1.vSub.AsDouble;
I have also tried it in the subreport by referencing the main report using
the following but get errors:
Report.Variable1.AsDouble :=vSub.AsDouble;
I know I am missing something but just can't get it to work.
Thanks,
Bob
variable in a subreport?
I have tried the following but get errors:
Variable1.AsDouble :=SubReport1['vSub'].AsDouble;
Variable1.AsDouble :=SubReport1.vSub.AsDouble;
I have also tried it in the subreport by referencing the main report using
the following but get errors:
Report.Variable1.AsDouble :=vSub.AsDouble;
I know I am missing something but just can't get it to work.
Thanks,
Bob
This discussion has been closed.
Comments
Are you making these calls from RAP or Delphi code?
If this is from Delphi, you are given direct access to each variable when
you place them inside a report. For instance from the OnCalc of the
variable inside the subreport, (vSub) you might say...
Variable1.Value := Variable1.Value + Value;
If you are coding in RAP, you will need to create a global variable and set
it equal to the variable in the main report to gain access to it from the
OnCalc event of the subreport variable. Take a look at the following
example on how this can be done.
http://www.digital-metaphors.com/tips/RunningTotalInDetailSubreport.zip
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
a global variable and resolve the issue.
Thanks,
Bob