cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a variable from subreport to main report

Former Member
0 Kudos
1,276

Hello,

Was hoping to get some assistance on this issue I'm facing.  I've got a sub-report that calculates a monthly goal based off the date selection criteria. And I'd like to pass this goal back to the main report.

In my sub-report, I created a new formula named ProcGoalVariable:

WhilePrintingRecords;

Shared Numbervar ProcedureGoal := cdbl({#ProcGoal})

While {#ProcGoal} is a running total I created for the sub-report and now I'd like to pass it back to the main report.

In the main report, I created a new formula named ProcGoalVariable:

Shared NumberVar ProcedureGoal;

ProcedureGoal;

But when I drop this into my report, it is returning a value of 0.  In the screen shot, the Proc. Needed should actually equal the Proc Goal:

Any suggestions on how to pass this correctly?

View Entire Topic
sylvainchevalle
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Trey,

Which value do you see in your variable at the end of the subreport?

If it is not the expected value then you still an issue in the subreport....

If you see the value in the subreport then try to assign the value to your return variable in the main report... as you describe it, it seems that is still empty...

like :

Shared NumberVar ProcedureGoal;

ProcedureGoal:=ProcedureGoal;

Good luck and Kind regards,


Sylvain