NumberVar in Crystal XI showing one row off?

stlinae
stlinae used Ask the Experts™
on
I think I might know the answer to this, but I'm really hoping I'm wrong. Sub report has a shared NumberVar Total in it. When I call the variable and place it in the Main report, it ends up showing on the next detail line down from where it should be. The Main report is a Store Procedures, pass through report and does not have, nor can it have any groupings. It has Detail A and B, that's it.
How do I get the shared numbervar to show within the correct line. (I need it use it in a formula adding fields.)
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Make sure you have the shared variable declared in the main report before the subreport.
Also you can't use the subreport value until after the subreport section.

IN the main report add a formula to the report header
WhilePrintingRecords;
Shared NumberVar YourVariableName;
''

Where is the subreport - section?
WHat section are you displaying the value?

mlmcc

Author

Commented:
In the SubReport, the variable 'TotalInc' is in a group footer. The subreport itself is in DetailB of the main report. I have initialze the shared var in the header of the main report. Then define it in the subreport and call it in the main report in the same DetailB section of the main report that the subreport is in. THe variable does come over, it's just one line off.

Author

Commented:
I just noticed that, while the formula to initialize the variable is in the report header in the detail screen of the main report, when I preview, it shows in the page header section??? mean anything and if so, how do I correct it?
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
The problem is probably that the main report prints the value before the subreport runs.

Does the subreport producce any other output or is it used to get the shared value?
If just the shared value then put it in Details A or create a new Details B and put it there.

mlmcc

Author

Commented:
Thanks fo much. Creating another detail section for just the subreport seems to be working!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial