Skip to Content
Author's profile photo Former Member

Suppressing “Zero” Entries In Chart Legend

Result from Crystal Report for Legend :

Screen.jpg


Expected Result for Legend:

Screen.jpg

Steps:


1. Create a Manual Legend as shown in the Screen Shot.

Screen.jpg

2. To Create a Manual Legend use BOX option. Draw a box and place the small boxes with giving the Legend colors

Screen.jpg

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.

Screen.jpg

               

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

Screen.jpg

10. The Result will be as shown in the Screen shot.

Screen.jpg

11. Remove the Chart legend by clicking chart expert and you will getting the result.

Screen.jpg

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      good one..

      Author's profile photo Former Member
      Former Member

      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...

      Author's profile photo Former Member
      Former Member

      Nice document. It would be much more crisp with information if pie chart is represented with more data with additional data.

      Author's profile photo Satendra Kumar Srivastava
      Satendra Kumar Srivastava

      Good Document , Thanks for sharing .