cancel
Showing results for 
Search instead for 
Did you mean: 

How to suppress columns when no data

0 Kudos

Hello All,

I am using crystal reports Enterprise Edition. The report needs to display all the 50 columns. When any column does not show any data it should not display. how to do this ?

Please help

A B C D E F G

12 12 0 34 34 34 0

The report should not display C and G column as it does not have data.

Please help how to do this in crystal report.

Thanks

Radhika

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor

Hi Radhika,

Right-click each field on the details section > Format Field > Click the formula button beside "Hide" and use this code:

Maximum({Column_Name}) = 0

Use this same formula on the column header as well.

-Abhilash

0 Kudos

Thank you so much.

Answers (1)

Answers (1)

DellSC
Active Contributor
0 Kudos

The challenge with this is that the columns will not automatically move to the left to fill in the space where the suppressed columns are. Also, I'm not sure whether the Maximium trick that Abhilash mentions will work with string fields.

I have done this sort of thing on some smaller reports - the trick is that you have a formula for each column that will check to see how many columns previous to the one you're working on are suppressed and then determine which data it needs to show. With 50 fields, this is going to be very cumbersome to get the formulas correct.

-Dell

0 Kudos

Thank you Christy...