Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Chart based upon formula values Post Reply Post New Topic
Author Message
RonK
Newbie
Newbie


Joined: 14 Aug 2009
Location: Netherlands
Online Status: Offline
Posts: 7
Quote RonK Replybullet Topic: Chart based upon formula values
     Posted: 20 Aug 2009 at 5:44am

I'm trying to create a chart based upon formulas referring to shared variables set by a sub reports. I do not get the correct values, why not?

 

First I created a simple chart in the group header 2:

On change of = Contract - Show = Formula: Count ({Order}, {Contract})

Big%20smile NO PROBLEM!

 

Then I created a second chart in the same group header:

On change of = Contract, Show = Sum of Formula: sum of @Amount 

Confused PROBLEM! All zero !?

 

The formula @Amount is only referring to another formula called @AmountShared: shared numbervar AMMOUNT

 
The formula @AmountShared is on group footer 3 and shows the correct values.
 
I have tried moving the charts to the group footer instead of header. Same result, the first charts shows values, the second does not.
 
I have tried other formulas, not referring to shared values, they do not have this
problem. So it must have something to do with the shared values which i need to use because of the complex data structure ...
 

How can I get these values in my chart.



Edited by RonK - 20 Aug 2009 at 5:52am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Aug 2009 at 6:34am
Just to clarify, you have 3 grouped levels not just GHa, GHb, GHc, correct?
When you say you moved it to the Group Footer, which Group Footer was it? Was it in a section after the GF3 where you are getting the proper value?
IP IP Logged
RonK
Newbie
Newbie


Joined: 14 Aug 2009
Location: Netherlands
Online Status: Offline
Posts: 7
Quote RonK Replybullet Posted: 21 Aug 2009 at 7:02am
Yes, I do use grouped levels.
 
The shared values are (re)set to on GroupHeader3.
The subreports calculating the shared values are at the Detail section.
GroupFooter3 shows the sum of these values at contract-level.
GroupFooter2b shows the sum of these values at customer-level.
 
GroupFooter2c holds two charts. One with a simple count of details lines per contract, which works just fine. One with the sum of a shared value, again per contract. The last one shows zero for each contract ... Cry
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Aug 2009 at 8:53am
Sorry, not sure why it is doing that. I try to avoid sub reports as much as possible. I use stored procedures or views to get the data in a format that I can use to avoid them. Might that be a solution for you? Generaly you will get better report performance that way as well...
IP IP Logged
RonK
Newbie
Newbie


Joined: 14 Aug 2009
Location: Netherlands
Online Status: Offline
Posts: 7
Quote RonK Replybullet Posted: 21 Aug 2009 at 9:17am

I know what your are saying. Yes, I could prepare data in a much simpler form to avoid issues like these. But the thing is: I was asked to show what can be done with Crystal, without data preparation thru stored procedure and such. Maybe you and me can build stored procedures, but that's not true for everybody. And it seams kind of silly to me, if it were true, that I would have to start building stored procedures for all those “I need it right now” report questions I get so often.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Aug 2009 at 9:42am

understood. I do find I can get almost allways get what I need using Running Totals without using sub reports unless the sub reports are reusing the sam data over and over (same data required to be grouped multiple times)...

I'll play around with it when I get some time and see if I can make sense of it. What are the formulas are you using the main report for this?
IP IP Logged
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