I have a simple report with about 20 columns. Some of these columns might be empty. Here's what I am trying to do:
I have some ideas of where to start with but not sure how to move forward. I can check if a column is empty by :
If DistinctCount({@SomeField}) > 0
I also know that the width and position can be changed by the formatting formulas. But how do I put this together? That is, what logic would run to check and expand the columns and where do I put this logic? Should I be using global variables?
Any suggestion would be helpful.
Thanks
Note: I am using Crystal Report XI
Try this approach:
WhileReadingRecords;
Global booleanVar col1Empty := True;
Global booleanVar col2Empty := True;
...
if not IsNull({dbtable.col1}) then
col1Empty := False;
if not IsNull({dbtable.col2}) then
col2Empty := False;
Then use this global variables in suppres formulas.
Then count how many are not empty can calculate the average column width.