Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula in Bar Graph

Status
Not open for further replies.

pelajhia

Programmer
May 19, 1999
592
US
I am having a serious 'too many chocolate eggs' brain seizure. I couldn't even get a keyword search to run on this, so I'm posting my silly question:
I created a report with a very simple formula,

if {ocr_confid_nbr} >=94
then
1
else
0

And then I did a running total formula on this, grouped by month. These are working fine.

When I tried to create a bar graph, I see 'report fields', but not my running total. Will I be unable to show this value in a graph?

 
Base the bar chart on the formula, not the running total.

In the Advanced area of the bar chart, place your date in the On Change Of, select Order, Chart Values Shown for each month.

In Show Values place your formula.

-k
 
It's been a few days since I've been able to look at this particular report, but I tried to create the chart again, and I don't see the base formula listed in the fields either. Other formulas are there, just not that one. :(

I can use a percent formula that I've created using the first formula, so I'm in ok shape, but it's just weird.

The base field is called OCR94andUP, and here's the cut and pasted innards:

shared numbervar count94;
if
{LANE_VIOLATIONS.OCR_NBR_CONFID}>=94
then
count94:=count94+1
else
count94;

Here's another one called OCR94Percent, and it's contents:
if
({@ViolationRunningTotal}+{@DelCount})>0
then
100*(
{@OCRRunningTotal}/({@DelCount}+{@ViolationRunningTotal})
)
else
0

I can SEE OCR94Percent in the chart expert; it's in a footer. I can't see OCR94andUP, it's in the details, if that makes any difference.
 
I am now working on another report, and seeing a similar problem when I attempt to add a pie chart. Arg.

I have a main report with subreport which both pass values to a second subreport which does some calculations and passes the grandtotals for several columns back to the main report. This all works fine, but when I attempt to insert a chart, I do not see the grand total formulas in the list of 'available fields'.
I tried to 'wrap' these formulas in additional formulas, and these show up in the list, but show on the chart as equal to zero, despite showing right next to the chart as having a value.
Will the chart expert choke on anything that is not pretty much a straight number?
I tried the trick I used last time (see above) where I just calculated the percents myself and used these to create the chart, but, although these formulas show in the list, they don't appear to have any 'value' according to the chart output.
The pie doesn't show at all, just a list of the formulas used with the corresponding colors.

Here is an example of what my report looks like:

cust serv. collections other total
123.00 50.00 45.00 218.00 - subreportA
100.00 50.00 50.00 200.00 - subreportA
80.00 20.00 100.00 200.00 - subreportA
---------------------------------------
303.00 120.00 195.00 618.00 - main report

I would like the pie to show the percents that the first
3 columns make up of the total column.

I've tried putting this in a year group footer vs. the report footer, using 'on change of' year vs. for all records. I am getting no where.
HELP, please!
Thanks.
 
I am having a similar problem. My formula is based out of a parameter field. This formula does not show up in the Available Fields box while creating a chart. Any solution to this?
 
Well, Found a way out for this problem with help from another thread in this forum.

As I suspected, the problem was because the formula was based out a parameter field and Crystal reports could not probably suggest the time of evaluation by itself. So when I added a "WhileReadingRecords;" in the beginning of the formula, It worked. It showed up in the Availabe Fields box in the chart.
 
Yes, evaluation times defnitely played a part in my problem, too. Unfortunately, since I was using subreports which apparently get evaluated after EVERYTHING (not quite), the charts never got the news from the subreports.
Anyway, this was resolved by moving to CR9, and making a more complete sql query which did not need to be broken up into various subs. Phew.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top