Search code examples
pentahoreport-designer

pentaho report designer display field over field2 if 'field2' is not present


Let's say I want to make 2 text fields next to eachother. On the screenshot below you can see 2 fields. The field on the left will always show.

Pentaho fields

But if the field on the right isn't filled in, I want to make it disappear but the text from the first field would have to go over the whole width of the page.

How do I make it overlap ONLY if the other field is empty?

Basically: When field 2 is present then field 1 has to be 275 width. When field 2 is not present (so empty ) --> Field 1 would be 475 width


Solution

  • You can try to define expression for width property of field1. IF(ISERROR([coachee_conclusion_html]);475;275)

    However, I am not sure about the function which should check if value is not present. In version 3.5 for example, you can use IF(LEN([coachee_conclusion_html])>0;275;475) instead.

    Possibly, you would also need to hide the right field (to prevent overlapping) by setting expression for it's visible property NOT(ISERROR([coachee_conclusion_html])) or LEN([coachee_conclusion_html])>0