Print Page | Close Window

Chart based on a formula

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1997
Printed Date: 27 Apr 2024 at 6:39am


Topic: Chart based on a formula
Posted By: yggdrasil
Subject: Chart based on a formula
Date Posted: 08 Jan 2008 at 4:42am
I am trying to add a chart to my report. All the 'help' and books I have say formulae can be used but the ones I have do not appear in the list of fields to choose from.
 
These are percentages based on running total fields, they sit in the group footer and are just numbers.  (eg, 100*(total A + total B)/total C)
 
I am using Crystal 10. Is there any way to get the chart to see these fields, or another way of creating them so it can?   (It works ok if I put 'total A' alone, but that is not what is required.)
 
Also, the only option I have for designing the chart is the Advanced button, despite the fact that I have groups and summaries in the report.  I had thought the Group option might be what I wanted, but it isn't available.  This does not match what the 'help' says, what is it that makes other options work?
 
That's two questions I suppose, but they are linked.   TIA for any advice.
 



Replies:
Posted By: Lugh
Date Posted: 08 Jan 2008 at 11:47am
Charting on formulas can be very tricky, and very frustrating.  Some formulas are simply calculated too late in the Crystal system to be used in a chart.  Yours is a good example of such.

Out of curiosity, could you try creating the formula using summary functions instead?  I.e., make your formula look like:

100 * (SUM({MyReport.A},{ MyReport.MyGroup}) + SUM({MyReport.B},{MyReport.MyGroup}) / SUM({MyReport.C},{MyReport.MyGroup})

Crystal may be better able to process this formula, rather than a running total.

Honestly, I strongly recommend that you only use the Advanced button.  The Group button is basically a simplified wizard, to create the chart based on existing groups and summary fields.




Posted By: yggdrasil
Date Posted: 09 Jan 2008 at 4:32am
Thanks for that.
You say "Some formulas are simply calculated too late in the Crystal system to be used in a chart. " I thought if you had the formulae in the group footer the result would be available in the report footer.
 
I will try the SUM route and see what happens Smile
 
As to the Advanced/Group buttons, it just worried me that the Group etc were greyed out. I was wondering what criteria Crystal used to decide that.
 


Posted By: Lugh
Date Posted: 09 Jan 2008 at 5:07am
Mostly, it uses where you put the chart.  Putting the chart in the report footer is a non-standard location.  So, reasons Crystal, you probably want a non-standard solution.  The Group solution is extremely bog standard.  So, it doesn't even offer it up to you.

Well, ok, actually the reason has a lot more to do with the way Crystal reads in and processes information.  But, really, it still pretty much boils down to what I said.


Posted By: yggdrasil
Date Posted: 10 Jan 2008 at 6:20am
I have it working now  Smile
The chart can see the sums where it couldn't see the running totals, and it now looks very pretty!
 
And the Group button has reappeared now I don't want it any more.
Thanks for all your help.


Posted By: Pablo84
Date Posted: 26 Nov 2008 at 4:41am
I have the same issue except for the fact that my running total is evaluated using a condition e.g. fieldValue = 1
 
I am using Crystal Reports 11.
How can I work around this?
 
Thanks in advance!



Print Page | Close Window