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.
jssys2Asked:
Who is Participating?
 
mlmccCommented:
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
   Click INSERT SECTION BELOW
   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

mlmcc
0
 
jssys2Author Commented:
That was exactly what I needed, it worked perfectly.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.