Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Sub Reports and Shared Variables Post Reply Post New Topic
Author Message
Molly
Newbie
Newbie
Avatar

Joined: 28 Apr 2011
Online Status: Offline
Posts: 10
Quote Molly Replybullet Topic: Sub Reports and Shared Variables
    Posted: 05 May 2011 at 5:27am
I am trying to do a calculation based on two sub reports,
Not sure what all information is relevant but, I have two groupings with details suppressed and the data is in the inner group (group2) footer. Which looks like this


CustomerName             SUBREPORT1       SUBREPORT2           CALCULATION


each sub report has a number shared variable that, and the difference of the two is printed in the 'calculation'.

my problem is that the calculation is being printed on the row below the one i need it (on the first row the calculation is 0).  I'm guessing because the Calculation field is printed first and then the sub reports are calculated.

Is there a way to fix this somehow?  Any help is greatly appreciated!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 05 May 2011 at 6:31am
you can run the subreports is a different section of the footer, above the calculation.  If you want everything on one line, and the results of the subreports are more than 1 line, things can be complicated, but if the results are nothing more than the shared variable you can do:
 
place the subreports in there own section of the band.  in the subreports, supress the output fields.  In the section that the subreports run, go to the Section Expert and check the option 'Supress blank sections'.  This will effectively 'Hide' the subreport and their output.  To display the values, create formulas to display the appropriate shared variables and calculation.
 
HTH
 
thanks to DBlank for reminding me how to 'suppress' a subreport, I forget every now and then.
IP IP Logged
Molly
Newbie
Newbie
Avatar

Joined: 28 Apr 2011
Online Status: Offline
Posts: 10
Quote Molly Replybullet Posted: 05 May 2011 at 6:42am
Great Idea!  Thanks a lot.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.000 seconds.