We help IT Professionals succeed at work.

Formula causing blank spaces in Crystal reports

Nicole Furnival
on
I have written the following formula in Crystal reports. If {CnAttrCat_1.CnAttrCat_1_Description} = True then "" else {CnAdrSal.CnAdrSal_Addressee}. The problem is, when I view this information now, there are blank spaces when {CnAttrCat_1.CnAttrCat_1_Description} = True. Is there a way to supress these?
Thank you!
Comment
Watch Question

Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
If you have several fields side-by-side, they don't shrink/expand in width to accommodate the data or lack there of.

If you have several text fields side-by-side you could combine them in a formula like

[{Namefield} + {Address1 field} + (If Not IsNull({Address2 Field}) Then {Address2 Field}) + {CityField} + ", " + {StateField}

Author

Commented:
The only field in the report is the one addressee field. When the report is previewed, many of the lines are blank and the blank fields take up a line, so there are random spaces in the report, I know I have encountered this problem before, something about if Isnull, but I cannot remember where I add this in the details section, any help would be appreciated.
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
FOr blank lines use the section expert

Click REPORT --> SECTION EXPERT
Select the section with the field in it
Click SUPPRESS BLANK SECTION

Try the formula this way

If {CnAttrCat_1.CnAttrCat_1_Description} = FALSE then
      {CnAdrSal.CnAdrSal_Addressee}


mlmcc

Author

Commented:
Thank you! The first option fixed it!