Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Yet another questions about subreport totals Post Reply Post New Topic
Author Message
theghetto
Newbie
Newbie


Joined: 17 Feb 2010
Online Status: Offline
Posts: 8
Quote theghetto Replybullet Topic: Yet another questions about subreport totals
    Posted: 10 May 2012 at 2:03pm
I have a variable from a sub report being passed to the main report. That variable is a sum of a column in the sub report. I'm then summing the sum in the main report using a global variable and that is all working fine.

But, the data in the sub report is being filtered not just by the default parameter linking sub report to main report, but also by a user input parameter on a column in the sub report.

The end result is the main report is displaying the proper lines from the sub report that I want (although there is a blank detail line with a header from the sub report where the user input parameter doesn't match.)

The problem is the variables are including the data that is hidden on the main report, summing the values that are filtered by the user input parameter.

I hope this makes sense, very difficult to explain this properly.   Can anyone help me with this?

Thanks,

Matt

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 11 May 2012 at 4:14am
sounds like you need to adjust the logic for the shared variable in the subreport.
 
if you are just using SUM in the subreport, it will report everything, including items that were suppressed. To correct this, you would want to increment your shared variable for each line of detail that is displayed, then the variable will always represent what the user is seeing on the report.
 
HTH
IP IP Logged
theghetto
Newbie
Newbie


Joined: 17 Feb 2010
Online Status: Offline
Posts: 8
Quote theghetto Replybullet Posted: 16 May 2012 at 6:46am
Thanks for your response, I'm just finally getting back to finishing this report.

Can you get me a bit closer here?   I'm comfortable with Crystal but am fairly new to playing with variables.

Right now I just have a formula in the subreport called "shared" that contains

shared numbervar test:={@sum2};

I understand what you are saying about incrementation, but what's the syntax to say "where the detail line is displayed" ?

Thank you for your help!

Edited by theghetto - 16 May 2012 at 6:47am
IP IP Logged
theghetto
Newbie
Newbie


Joined: 17 Feb 2010
Online Status: Offline
Posts: 8
Quote theghetto Replybullet Posted: 16 May 2012 at 7:55am
Oh I think I've got it.

I placed the formula on the detail line of the subreport, and changed the formula to

shared numbervar test:=test+{@subtotaqls};


That seemed to have done the trick.   Thank you!

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.016 seconds.