1
votes

I'm building a report with Crystal Reports. So I have a section that can have the value from a table. This section writes the result of a query and can have 1, 2 , 3 , , N row.

I have set this setting of this values:

enter image description here

enter image description here

If the column does not have a value, I don't display the result and this is ok, but the report shows the blank space. How can I delete this blank space ?

EDIT The result of my Table5 can be never record or more record. I want to suppres the blank space if the Table5 not have record

EDIT 2 This is the detail section: enter image description here

I want to delete the part

Parametro | Valore | U.M. | Valori di riferimento
1

1 Answers

2
votes

If the value is only white space, or more precisely, only contains space-characters, you can use the Trim-function.

Trim({Table5.Colonna1})

or when you want to suppress the field if it's just white space, put this in the suppression-formula:

Trim({Table5.Colonna1})=""

EDIT

To get rid of the blank part:

  • Create a new DetailSection below the existing one.
  • Move the fields Colonna1, Colonna2, Colonna3, Colonna4 and the belonging headers to the new section.
  • Edit the suppression-formula of the new DetailSection and insert the following formula

formula

If IsNull({Table5.Colonna1}) And IsNull({Table5.Colonna2}) And
   IsNull({Table5.Colonna3}) And IsNull({Table5.Colonna4}) Then
    True
Else
    False

If Colonna1, Colonna2, Colonna3 and Colonna4 can not contain the value NULL inside the database, you could only query one of them and shorten the suppression-formula like following (the same as in your printscreen):

IsNull({Table5.Colonna1})