Reputation: 153
How to Change Legend Text of a Chart Object in Crystal Reports 10?
I did a report with chart by Crystal Report. The chart show me how many males and females there. So now the male enter to database as int
= 0, and the females enter to database as int
= 1, so in legend of chart display 0 = 226 and 1 = 44, means that the Males = 226, and the Females = 44. I need to make a formula that can change the 0 to Males, and the 1 to Females. please see the picture below:
See the Format Object I couldnot find any Display strings formula:
Upvotes: 1
Views: 13934
Reputation: 51
Obtained here:
I had the same dificulty and found de answer (at least for me, was the solution).
Below (I use CR 2008):
1. Open report in CR.
2. Set report do "Preview Mode" by clicking View -> Print Preview
3. When in "Preview Mode", select the Legend label you want to change the text of.
4. Right click on the Legend label and select "Edit Axis Label"
5. Then, select the chart, right click and select Chart Expert -> Apply template to group.
6 Save the modified report.
Upvotes: 5
Reputation: 21
create a formula field, give it the name you would like i.e. males, then assign it the value of the data field. use the formula field in the chart itself. now the legend will read @males and you will get correct data.
Upvotes: 2
Reputation: 1244
You had a formula "DisplayString" that does what you need, why don't you use this formula in the chart as values to show?
Instead of using the field directly, you can use the formula and problem solved!
Or is there something that prevents you from doing that?
Upvotes: 3
Reputation: 2750
The only way I know how to change the data labels is by previewing the report, selecting a label, right-clicking on the label and then selecting "Edit Axis Label". It's called a label alias.
Upvotes: 0