sdonaldson
Programmer
I have a problem passing data from a subreport to the main report via a shared variable.
I am using CR 8.5.0.217 Developer Edition on Windows 2000.
Main report has following formulae:
Report Header:
--------------
{@Year1YTDActualRunningTotalReset}
WhilePrintingRecords;
Global CurrencyVar Year1YTDActualRunningTotal := 0;
Shared CurrencyVar SharedYear1YTDActual := 0;
Details :
------------
{@Year1YTDActualRunningTotalCalculate}
WhilePrintingRecords;
Shared CurrencyVar SharedYear1YTDActual;
Global CurrencyVar Year1YTDActualRunningTotal := Year1YTDActualRunningTotal + SharedYear1YTDActual;
Report Footer:
--------------
WhilePrintingRecords;
Global CurrencyVar Year1YTDActualRunningTotal;
Year1YTDActualRunningTotal
The Details [a] section of the main report contains a subreport as follows:
Details:
--------
{@Year1YTDActual} formula which adds one or more table fields together according to the value in a parameter which is passed into the subreport from the main report.
This formula is working OK.
Report Footer:
--------------
{@SetSharedVariables}
WhilePrintingRecords;
Shared CurrencyVar SharedYear1YTDActual := {@Year1YTDActual};
SharedYear1YTDActual
Problem is that the SharedYear1YTDActual variable is being populated by the subreport (it shows the correct value in the subreport Report Footer), but it is always zero in the main report.
The value assigned to SharedYear1YTDActual in the {@Year1YTDActualRunningTotalReset} formula in the main report Report Header is the only value that the {@Year1YTDActualRunningTotalCalculate} formula gets.
Am I missing something or is there a problem with shared variables in v8.5 ?
Thanks in advance,
Shaun
I am using CR 8.5.0.217 Developer Edition on Windows 2000.
Main report has following formulae:
Report Header:
--------------
{@Year1YTDActualRunningTotalReset}
WhilePrintingRecords;
Global CurrencyVar Year1YTDActualRunningTotal := 0;
Shared CurrencyVar SharedYear1YTDActual := 0;
Details :
------------
{@Year1YTDActualRunningTotalCalculate}
WhilePrintingRecords;
Shared CurrencyVar SharedYear1YTDActual;
Global CurrencyVar Year1YTDActualRunningTotal := Year1YTDActualRunningTotal + SharedYear1YTDActual;
Report Footer:
--------------
WhilePrintingRecords;
Global CurrencyVar Year1YTDActualRunningTotal;
Year1YTDActualRunningTotal
The Details [a] section of the main report contains a subreport as follows:
Details:
--------
{@Year1YTDActual} formula which adds one or more table fields together according to the value in a parameter which is passed into the subreport from the main report.
This formula is working OK.
Report Footer:
--------------
{@SetSharedVariables}
WhilePrintingRecords;
Shared CurrencyVar SharedYear1YTDActual := {@Year1YTDActual};
SharedYear1YTDActual
Problem is that the SharedYear1YTDActual variable is being populated by the subreport (it shows the correct value in the subreport Report Footer), but it is always zero in the main report.
The value assigned to SharedYear1YTDActual in the {@Year1YTDActualRunningTotalReset} formula in the main report Report Header is the only value that the {@Year1YTDActualRunningTotalCalculate} formula gets.
Am I missing something or is there a problem with shared variables in v8.5 ?
Thanks in advance,
Shaun