Manish Parmar
Manish Parmar

Reputation: 859

Prevent textbox containing field with null value from taking up space

I have a textbox which is displaying the field Address2. If Address2 has a value, then no problem, but if it has no value, then the textbox is blank, but still takes up space in that portion of the report.

My problem is I don't want to put any blank space if the text box has a blank value for the Address2 field.

Upvotes: 1

Views: 4116

Answers (4)

Aaroninus
Aaroninus

Reputation: 1112

This will collapse any blank fields, but they must be inside the same text box.

From this post on the ASP.NET forums:

1) Stick your fields into a text object (if you have not already done so)

2) Right click on the object and select Format Object

3) Scroll to the bottom and click the checkbox "Supress Embedded Field Blank Lines"

In CR 2013:

enter image description here

To prevent the text box from taking up extra height with empty space, utilize Charles' answer by shrinking the text box to the minimum size required and checking CanGrow in the formatting options.

To handle any labels, for instance if you wanted to display the text Address 2: next to the Address2 field, add a formula field Address2Label and sets its formula to

IF ( ISNULL(Address2) ) THEN
    ""
ELSE
    "Address 2:"

then place this in the text box.

Upvotes: 0

Charles Bretana
Charles Bretana

Reputation: 146499

Change textbox height to zero and set CanGrow to true ?

Upvotes: 1

Sagar Savsani
Sagar Savsani

Reputation: 25

Remove your suppress formula from textbox and write it to the detail section in which you place your textbox.

Upvotes: 0

Adriaan Stander
Adriaan Stander

Reputation: 166396

Right click the textbox and select Format Field

Select the Common tab

Click the Formula button next to the Suppress

Change the formula to something like

IsNull({REPORT;1.Address2}) or {REPORT;1.Address2} = ""

Click Save and Close

That should about do it.

Upvotes: 1

Related Questions