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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why can't I see all formula fields in chart section

Status
Not open for further replies.

mak101

Programmer
Feb 5, 2003
17
US
I have created crystal report using version XI. I have created formula field which calculates % of two database field. Which I display in detail section. I also created formula fields to display % for the group. Now I want to add chart for each group based on formula fields for group %. But I can't see these fields in available fileds in chart-data tab. Here is my example:



July August September October November December January February March April May June
Region 1 22.84 21.9 21.71 23.18 22.98 22.88 24.37 25.16 24.96 24.54 23.67 24.12
Region2 20.45 20.17 20.68 21.33 21.98 23.67 24 21.65 22.05 22.53 23.89 23.04
Region 3 12.64 14.44 14.66 16.32 15.88 11.84 12.54 13.96 14.89 13.99 12.05 12.23
Region 4 15.94 17.57 17.77 17.28 16.6 17.7 17.21 16.63 17.37 16.86 16.67 15.04
Region 5 28.84 26.83 27 26.78 26.73 25.26 25.13 23.59 23.97 24.12 23.17 20.26
Region 6 23.46 23.32 21.85 23.66 22.16 22.05 22.27 22.31 20.78 19.44 19.6 18.38

% of Sale by all Region 24.94 24.6 24.73 25.58 25.46 25.41 25.97 25.49 25.28 24.74 24.09 23.49


all the data in details section comes from formula field Like @JulyRate, @AugRate - This is the rate of particular item sold against all items sold.

% of sale by all region in group footer also come from formula field like @JulyGroupRate, @AugGroupRate

Now I want to add chart in group footer which shows % of the item sold in each month.

I can see @JulyRate in available field but can't see @JulyGroupRate! Why is that?



Can anyone please help?



Thanks.
 
We would have to see the content of (some of) your formulas to know why.

-LB
 
@JulyRate
whileprintingrecords;
(100 * {SalesSumm.ItemSale7})/{SalesSumm.totalSale7};

@JulyGroupRate
whileprintingrecords;
NumberVar nJulyItemTotal/ NumberVar nJulyGroupSale * 100;

@JulyRunningTotal
whileprintingrecords;
NumberVar nJulyItemTotal;
NumberVar nJulyGroupSale ;
nJulyGroupSale := nJulyGroupSale + {SalesSumm.totalSale7};
nJulyItemTotal := nJulyItemTotal + {SalesSumm.ItemSale7};

@JulyReset
whileprintingrecords;
NumberVar nJulyGroupSale := 0;
NumberVar nJulyItemTotal := 0;

These are functions I use to calculate % and reset values when group change. @JulyRunningTotal I use in detail section and suppress, @JulyReset I added in group header to reset total to zero.

Hope this will help to usderstand the problem.

 
Eliminate both the variables and the whileprintingrecords, as there appears to be no need for them, and use formulas instead, e.g.,

//{@JulyRate}:
{SalesSumm.ItemSale7}%{SalesSumm.totalSale7}

//{@JulyGroupRate}:
sum({SalesSumm.ItemSale7},{table.groupfield})%sum({SalesSumm.totalSale7},{table.groupfield})

-LB
 
LB,

Do you mean I dont need any formula? Instead I can use direct fileds? If so how?

Thanks.
 
Try using formulas like I showed above.

-LB
 
It worked. Thanks a bunch. So what was the reason I was not able to see all formula fields?

Now I am able to add chart with group rate for all 12 months but how do I lable each column as month name? Sorry for ny limited knowledge in Crystal.

Thanks again.
 
Because you were using variables--"whileprintingrecords." If you go into chart options->data labels->label format you can select "Label" to label the series. Charting isn't one of CR's strengths.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top