Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Text Field Data Conditional Formating Post Reply Post New Topic
Author Message
janice
Newbie
Newbie


Joined: 25 May 2012
Online Status: Offline
Posts: 5
Quote janice Replybullet Topic: Text Field Data Conditional Formating
     Posted: 10 Oct 2012 at 4:22am
I have a data field in my crystal report details section,this field has "\n" character in the data,on the occurence of it i want to create a new paragraph with data after \n character.
 
 
Can anyone tell me how we can do such text conditional formatting.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 10 Oct 2012 at 5:34am
replace ({table.field},"\n", chrw(13) + chrw(10))
 
just replacing the \n which is a new line character with a carriage return / line feed combination
 
Like anything, it should work
IP IP Logged
janice
Newbie
Newbie


Joined: 25 May 2012
Online Status: Offline
Posts: 5
Quote janice Replybullet Posted: 10 Oct 2012 at 9:13pm
Thank You so much...it worked! Smile
IP IP Logged
janice
Newbie
Newbie


Joined: 25 May 2012
Online Status: Offline
Posts: 5
Quote janice Replybullet Posted: 12 Oct 2012 at 3:20am
Hi I have one more difficulty like same.
 
 
In the same data field i have data like "3(or any number) 1/2 hours" which i want to display like "3 ½ hours"         
please suggest
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 12 Oct 2012 at 4:47am
yeah, you got me on that one.  CR pretty much sets one font for the entire string. 
 
The only trick that I have heard of, would be to have basically 3 formulas which you could break up into everything before the 1/2 and after the 1/2 and the actually 1/2. Then you could build a text box with the 3 formulas set inside it so that they would all smash together and look like 1 string.
 
the formulas would be something like:
local numbervar half := instr({table.field}, "1/2");
left ({table.string}, half -1)
 
local numbervar half := instr({table.field}, "1/2");
mid ({table.string}, half +3)
 
local numbervar half := instr({table.field}, "1/2");
half > 0
 
then you could display the results, with the actual 1/2 symbol being a static field that you can hide....this is but one stab at it.
 
HTH
IP IP Logged
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