Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: extracting part of paragraph Post Reply Post New Topic
Author Message
Danie
Newbie
Newbie


Joined: 15 Sep 2011
Location: South Africa
Online Status: Offline
Posts: 13
Quote Danie Replybullet Topic: extracting part of paragraph
     Posted: 25 Oct 2011 at 12:59am
I would like to know how to extract the last part of an paragraph so that it can print it below the 1st part of the paragraph eg.

One (1) Speed Queen Model SCL40KN2 EL x 18 kg Heavy duty industrial microprocessor controlled (self heating) washer extractor. Suitable for 380 volt electicity supply. Machine Dimensions: wxdxh 778mm x 1009mm x 1199mm. Weight: 314 kg

The above description is drawn from a field on the item master and prints next to the item picture in the details area of the layout. The customer wants the last 2 lines -
'Machine Dimensions: wxdxh 778mm x 1009mm x 1199mm.
Weight: 314 kg', to print as a new lines underneath like this -

One (1) Speed Queen Model SCL40KN2 EL x 18 kg Heavy duty industrial microprocessor controlled (self heating) washer extractor. Suitable for 380 volt electicity supply.
Machine Dimensions: wxd h 778mm x 1009mm x 1199mm.
Weight: 314 kg

The 2nd last line always starts with 'Machine Dimensions' and the last line with 'Weight'

Is there a way to do this in Crystal, please?

Regards

Danie
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 25 Oct 2011 at 2:29am
local stringvar nReverse:=strreverse({table.field});
nReverse:=left(nReverse, instr(nReverse,'enihcaM')+6);
nReverse:=left(strreverse(nReverse), instr(strreverse(nReverse), 'Weight')-1);


local stringvar nReverse2:=strreverse({table.field});
nReverse2:=left(nReverse2, instr(nReverse2, 'thgieW')+5);

nReverse
& chr(13)
&
strreverse(nReverse2)


Set the field to Can Grow.



Edited by FrnhtGLI - 25 Oct 2011 at 2:29am
|< /\ '][' ( )
IP IP Logged
Danie
Newbie
Newbie


Joined: 15 Sep 2011
Location: South Africa
Online Status: Offline
Posts: 13
Quote Danie Replybullet Posted: 25 Oct 2011 at 2:45am
Hi
 
Thank you for the reply.
 
I'm still a novice in Crystal reports so this is Greek to me. Where do I insert this code? On the field properties?
 
Regards
 
Danie
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 25 Oct 2011 at 3:46am
No, create a new Formula Field from the Field Explorer. Where the above formula says {table.field} you must use the name of the field from you datasource that contains the paragraph information.

|< /\ '][' ( )
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