Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Add blank lines conditionally Post Reply Post New Topic
Author Message
Central
Groupie
Groupie


Joined: 16 Feb 2011
Online Status: Offline
Posts: 56
Quote Central Replybullet Topic: Add blank lines conditionally
    Posted: 04 Oct 2011 at 3:56am
How can I add a blank line conditionally.
 
I have fields in a text box and if an entry is blank or null then I would like a blank line. At the moment it is like below.
 
Smith
Jones
Green
 
Would like
 
Smith
 
Jones
 
Green
 
Don't want, if Jones is missing
Smith
 
 
Green
 
Would like if Jones is missing
 
Smith
 
Green
 
I hope this makes sense?


Edited by Central - 04 Oct 2011 at 3:59am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Oct 2011 at 4:12am
not exactly sure what you are asking for but perhaps this (depending on your CR version)...
right click on the text box
Format Text
Common Tab
Mark 'Suppress Embedded Field Blank Lines" option as TRUE


Edited by DBlank - 04 Oct 2011 at 4:12am
IP IP Logged
Central
Groupie
Groupie


Joined: 16 Feb 2011
Online Status: Offline
Posts: 56
Quote Central Replybullet Posted: 04 Oct 2011 at 4:20am
Thanks DBlank for the quick reply. I tried that and I think it will do.
 
Is there any code that I can put in e.g. If field is not null or blank then the next line be blank?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Oct 2011 at 4:28am
you want to add a carriage return per item that is not null into a single text box?
I assume you have a finite number of items you are doing this for.
You can make one big formula field
(if isnull(table.fieldB) then "" else table.fieldB + CHR(13))
+
(if isnull(table.fieldC) then "" else table.fieldC + CHR(13))
+
(if isnull(table.fieldD) then "" else table.fieldD + CHR(13))
 
or make individual formulas out of each of the above and then drag and drop them into the text box (like you did with the original fields)
IP IP Logged
Central
Groupie
Groupie


Joined: 16 Feb 2011
Online Status: Offline
Posts: 56
Quote Central Replybullet Posted: 04 Oct 2011 at 4:31am

I will try as above but this looks like what I am after.

Thanks again for your help.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.