Suppressing “Zero” Entries In Chart Legend
Result from Crystal Report for Legend :
Expected Result for Legend:
Steps:
1. Create a Manual Legend as shown in the Screen Shot.
2. To Create a Manual Legend use BOX option. Draw a box and place the small boxes with giving the Legend colors
3. Create a text boxes with column names as shown in above screen shot.
4. Create a summary fields using summary function.
5. A Manual Legend is now created.
6. Create a Empty text boxes as per the column name. for example in the above example there are Six legends so we are creating six text boxes.
7. Place the text box on each legend as shown in screen shot.
8. Give the text box’s background color as white.
9. Right click on each text box and give supression formulas
if Sum ({Sheet1_.Column1}) = 0 Then false else True
if Sum ({Sheet1_.Column2}) = 0 Then false else True
if Sum ({Sheet1_.Column3}) = 0 Then false else True
if Sum ({Sheet1_.Column4}) = 0 Then false else True
if Sum ({Sheet1_.Column5}) = 0 Then false else True
if Sum ({Sheet1_.Column6}) = 0 Then false else True
10. The Result will be as shown in the Screen shot.
11. Remove the Chart legend by clicking chart expert and you will getting the result.
good one..
That works if the last entry is 0 but what if any of the others is 0? You will have random gaps in your legend...
Nice document. It would be much more crisp with information if pie chart is represented with more data with additional data.
Good Document , Thanks for sharing .