Page 1 of 1

Text, remove newlines for empty lines.

Posted: Tue May 25, 2021 3:45 pm
by codemonkey
Hello!

Its probably a very easy thing but i canĀ“t find a solution to it.

I have a text field with 4 lines. The data comes from a SQL query.
Like
{Text0}
{Text1}
{Text2}
{Text3}
Sometimese some of those Texts are null or "". I want to remove the line break.

Like if Text1 is null i want it to output that way
{Text0}
{Text2}
{Text3}
So there is no empty line. It can happen for every line.

I played with IIF, <br> logic and can grow/shrink settings. Nothing works.

Thank you in advance!

Re: Text, remove newlines for empty lines.

Posted: Wed May 26, 2021 9:55 am
by Lech Kulikowski
Hello,

Depends on the report structure. You can place each text in separate Text components and set the CanShrink=true, DockStyle=Top. Or place it on different ChildBands.

Thank you.

Re: Text, remove newlines for empty lines.

Posted: Wed May 26, 2021 2:44 pm
by codemonkey
Hello,

thank you for the answer!
My problem is that i cant use dockstyle because there are some text components positioned at the same line in the databand.
Sadly i have no idea how to use ChildBands in this constelation and there are 6 text components in very cramped space and 2 of them should shrink while one has 4 possible lines and the other has 2. And the relative position of all elements should be maintained.

I solved it by using concat in the sql command and inserting HTML tags (<br>, <i> and </i>) at the necessarey spots and set the field to interpret HTML tags.

Re: Text, remove newlines for empty lines.

Posted: Thu May 27, 2021 9:04 am
by Lech Kulikowski
Hello,

Thank you for the information.