Crystal Reports XI passing sub-report values

I have created a Crystal Report where I pass a sub-report value to the main report.  The sub-report value is correct in the main report but when passing the value to the report it enters 0.00 in the first line then in the second line it enters the value that should be in the first line and so on, so the values are off by 1 line.  I have linked the reports together using the GL code and the date, but I can't figure out why it is off by 1 line.  The report is grouped and sorted by GL code.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subreports are the LAST objects evaluated in a section so if you are trying to use the value from the subreport in the same section it won't work unless the subreport is displaying the value.

The solution is to put the subreport into a section above where you need it.

I generally do this by adding a second section where I need it.
Say I want the value in the group 1 header
I add a second group 1 header section
   Right click theheader in the left margin
   Now have GH1a and GH1b
Since you probably have stuff in GH1a you can
   1.  Move everything to GH1b
   2.  Move G1b to be above gh1a thus swapping them

For this to work the subreport must be in GH1a and the formulas that use the returned values are in GH1b
Make sure the subreport doesn't display anything including blank strings (" ").
You can then set the subreport to SUPRESS IF BLANK in the SUBREPORT FORMAT (last tab)
You can also set the section through the SECTION EXPERT to SUPPRESS BLANK SECTION


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jssys2Author Commented:
That was exactly what I needed, it worked perfectly.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.