Print Page | Close Window

Suppress Empty Text Box

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=19824
Printed Date: 18 May 2024 at 7:57am


Topic: Suppress Empty Text Box
Posted By: doctork11
Subject: Suppress Empty Text Box
Date Posted: 30 Jul 2013 at 6:30am
Okay, here's my problem. I have 8 formulas. Each formula is similar to the following: "Text: " + {Command.CODE} + " - " + {Command.DESC}.
 
Then I add these formulas to a text box on the report. I format the text box to suppress if mailto:%7b@fmt1 - {@fmt1 } = "Text:  - " then true else false
 
The box is suppressed, but I want the report to "fit" the section as well.
Here's the layout:
fmt1    fmt2
fmt3    fmt4
fmt5    fmt6
fmt7    fmt8
 
If fmt3 - fmt8 are "empty" by the suppress formula, then fit the section to the bottom of fmt1/fmt2
 
Is that possible?



Replies:
Posted By: hilfy
Date Posted: 31 Jul 2013 at 5:10am
Resize the text box so that just fmt1 and fmt2 show.  Then right-click on it, select "Format...", and make sure that "Can Grow" is turned on.
 
Then, change your formulas - fmt1 and fmt2 stay the same, but the rest of the odd numbered ones will look like this:
 
if (not IsNull({Command.Code}) then
chr(13) + chr(10) + Text: " + {Command.CODE} + " - " + {Command.DESC}
else ''
 
And the even numbered ones will look like this:
 
if (not IsNull({Command.Code} then
chr(9) + Text: " + {Command.CODE} + " - " + {Command.DESC}
else ''
 
chr(9) = Tab character
chr(10) = Line Feed
chr(13) = Carriage Return
 
Take the manual returns out of the text box and let the formulas handle it.  So, what's in the text box might look like this:
 
{@fmt1}      {@fmt2}{@fmt3}{@fmt4}{@fmt5}...
     
If you have any data in the same section as the text box but which is displayed below the text box, create a new section under this section and move the fields to the new section.  The section that your text box is in will grow based on the size of the field and the other data will automatically appear below it no matter what the size is.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window