Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Trim Left (I think) / Finding Text in a field??? Post Reply Post New Topic
Page  of 2 Next >>
Author Message
motoxracer400f
Newbie
Newbie
Avatar

Joined: 11 Sep 2007
Location: United States
Online Status: Offline
Posts: 27
Quote motoxracer400f Replybullet Topic: Trim Left (I think) / Finding Text in a field???
    Posted: 03 Mar 2008 at 9:43am
Hi, I know that this is probobally a very ridiculous question, but I have searched to figure this out with little success and this is just driving me crazy!
 
I have a memo pad/text field on each record that has qoute information stored in it.  At the end of all this information, I am having the users hit enter 3 or four times and then typing "FOLLOWUPS:" and then keep a log of all this below that.
 
Now in the report how do I make it so it only displays from the "FOLLOWUPS:" on forward, that way you don't see all of the various quote information.
 
Thanks!!!
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 03 Mar 2008 at 10:27am
Hi,
 
Use the formula below and use left or right as per ur data...
 
if instr({table.field.name}, chr(13)) > 0
      then right({table.field.name},instr({table.field.name}, chr(13)))
 
Cheers
Rahul
 
IP IP Logged
motoxracer400f
Newbie
Newbie
Avatar

Joined: 11 Sep 2007
Location: United States
Online Status: Offline
Posts: 27
Quote motoxracer400f Replybullet Posted: 03 Mar 2008 at 11:02am
Thanks for the quick reply!!!
 
This doesn't seem to do anything.  What I am trying to do is basically search the entire text box, past all of the quote notes until it finds "FOLLOWUPS" and then return everything from the "FOLLOWUPS" through to the end of the document.
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 03 Mar 2008 at 11:56am
Hi,
 
The above formula check for carriage return character and prints the data to left or right of it.....
 
 
Can you post some sample data........to work on....
 
Cheers
Rahul


Edited by rahulwalawalkar - 03 Mar 2008 at 11:58am
IP IP Logged
motoxracer400f
Newbie
Newbie
Avatar

Joined: 11 Sep 2007
Location: United States
Online Status: Offline
Posts: 27
Quote motoxracer400f Replybullet Posted: 03 Mar 2008 at 1:11pm

<img src="http://www.freepicturehosting.com//is.php?i=635624&img=Report_2.jpg" border="0">



Edited by motoxracer400f - 03 Mar 2008 at 1:14pm
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 03 Mar 2008 at 2:18pm
Hi,
 
Use these formula
 
1) InstrRev is similar to Instr except that it searches the string in reverse order. In this case it looks for the last  enter i.e. CHR(13)

2) The Mid function without a third parameter will get the remainder of the string

if
instr({table.fieldname}, 'FOLLOWUPS:') > 0  then

Mid ({table.fieldname} ,InstrRev({table.fieldname},chr(13)))
 
 
I have not used text box instead i have used the formula on field ,you can do the same and place the formula in textbox
 
 
I used the following samples
 
 
AAAAAA
 
FOLLOWUPS:
text to be displayed two enters
 
 
BBBBBB
FOLLOWUPS:
text to be displayed one enter
 
 
ABCDEFGH
 
 
FOLLOWUPS:
text to be displayed three enters
 
 
 
 
Output
 
text to be displayed three enters
 
text to be displayed two enters
 
 
text to be displayed one enter
 
 
Cheers
Rahul


Edited by rahulwalawalkar - 03 Mar 2008 at 2:23pm
IP IP Logged
motoxracer400f
Newbie
Newbie
Avatar

Joined: 11 Sep 2007
Location: United States
Online Status: Offline
Posts: 27
Quote motoxracer400f Replybullet Posted: 04 Mar 2008 at 10:24am
Thanks!!!  I was able to get it to sort of work but not completely.
 
Here is the data that is stored in the field in my quote program:
 
TESTING
 

FOLLOWUPS:
[SHARON - 2/12/2008 ] - Kevin Ruby - 610-358-5919
innerliner / top cone, ext. pipe   -  Left message
2/15/08 - Not a job yet. price was good, still a month away before they get order.
 
After pasting your code I am able to get the textbox to display this value:
 
2/15/08 - Not a job yet. price was good, still a month away before they get order.
 
But I want it to display everything below the FOLLOWUPS: like this:
 
[SHARON - 2/12/2008 ] - Kevin Ruby - 610-358-5919
innerliner / top cone, ext. pipe   -  Left message
2/15/08 - Not a job yet. price was good, still a month away before they get order.
 
What do I need to change to accomplish this?  Thank you so much for your help!!!
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 04 Mar 2008 at 1:46pm
I think the confusion is coming from focusing on finding the Chr(13) in the text. I would only locate the "FOLLOWUPS:" in the text and print from there.

Building on Rahul's code:
if instr({table.fieldname}, 'FOLLOWUPS:') > 0  then 
Mid ({table.fieldname} ,Inst({table.fieldname},'FOLLOWUPS:')+11)


Edited by BrianBischof - 04 Mar 2008 at 1:46pm
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 04 Mar 2008 at 1:49pm
Hi
 
use the code below
if
instr({table.fieldname}, 'FOLLOWUPS:') > 0
then mid(Mid ({Table.FieldName} ,Instr({Table.FieldName},chr(13))),18)
 
Cheers
Rahul
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 04 Mar 2008 at 1:51pm
Thanks Brian
IP IP Logged
Page  of 2 Next >>
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.031 seconds.