on 2014 May 30 9:18 PM
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?
Request clarification before answering.
Thanks for the advice,
I want to rewind a bit to make sure I am explaining myself clearly. My sub-report is pulling the correct numbers and it is located in GF#3 and contains two values that fall under "Proc Goal" and "Prod Goal". These are being calculated correctly and I would then like to pass them back to the main report for additional calculations done on this.
In the sub-report, a formula was created "ProcGoalVariable":
WhilePrintingRecords;
Shared Numbervar ProcedureGoal := cdbl({#ProcGoal})
In the main report, a formula was created "ProcGoalVariable"
Shared NumberVar ProcedureGoal;
ProcedureGoal:=ProcedureGoal;
Would having the same name inside the formulas being causing the issue? And I've tried inserting a new section below the section where my subreport lives and I still get a value of 0.
Not sure what else to try at this point.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure, and I appreciate your time and assistance.
https://drive.google.com/file/d/0B8ErGi0v2xIJUVdJNjZvaVRUMXM/edit?usp=sharing
Thanks,
Hi Trey,
OK I see your problem. In your subreport simply insert your @ProcGoalVariable in the FOOTER in an hidded part of the subreport like this:
That should make the final result of your variable available for the main report but then you have to manipulate it always after the Group footer 3a anyway.
Regards,
Sylvain
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think at last running total has 0 values in sub-report,
you can check all the possible values by assigning it to
a shared string variable say X and then read it in your main report.
I faced the same situation before.
Regards,
Raghwendra.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Trey,
The Subreport has to be in a section above the formula that refers to the shared variable. Also the section that holds the subreport should not be suppressed for the shared variable to show the right value.
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Abhilash,
I'm not entirely sure what you mean by placing the sub-report in a section above the formula. My sub-report is in GF #3 and I placed the variable in GF#2 but the value being returned is still 0. I've tried placing the variable in various section including GH #3, GF #1 but nothing.
I've also inserted a section below GF #3 to create a GF #3A and GF #3B with the sub-report in GF #3A and the variable in GF #B.
Suggestions?
Thanks,
User | Count |
---|---|
61 | |
7 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.