-
Oct 21st, 2005, 11:19 AM
#1
Thread Starter
Hyperactive Member
Help me with this formula.
Hi!
I have to make a formula in Crystal Reports.Net, where I need to cut a field till a particular word and put the rest of the words left in a new line. e.g.
If my field contains "There was a boy who requsted a toy"
I have to show this as the following in my report.
There was a boy who
requested a toy
I am using the follwing formula
numberVar iCountLeft;
numberVar iCountRight;
iCountLeft=InStr ({RemedyDaily.customer_notes},"Requested")
iCountRight=InStrRev ({RemedyDaily.customer_notes},"Requested" ,0 )
Left ({RemedyDaily.customer_notes},iCountLeft ) & Chr (13) & Right ({RemedyDaily.customer_notes},iCountRight )
But, it gives me error "the remaining text does not apear to bepart of the formula".
Pls help how to achieve this. I am relatively new to Crustal Reports.
-
Oct 21st, 2005, 12:51 PM
#2
Re: Help me with this formula.
When setting variables you need to use := not just the equal sign.
Also, the statements which set variables need to end with a semi-colon.
iCountLeft:=InStr ({RemedyDaily.customer_notes},"Requested");
iCountRight:=InStrRev ({RemedyDaily.customer_notes},"Requested" ,0 );
-
Oct 24th, 2005, 10:49 AM
#3
Thread Starter
Hyperactive Member
Re: Help me with this formula.
Thanks.
Pls help me with this.
My string is like this:-
The boy who was blah blah blah 01/02/2003 11:12:32 AM was in blah blah 09/08/2005 12:11:15 AM blah blah
The output I desire on the report is like the following. It must be noted that string could be blank (so need to check that also)
The boy who was blah blah blah
01/02/2003 11:12:32 AM was in blah blah
09/08/2005 12:11:15 AM blah blah
Pls help me achieve this. I am relatively new to Crystal Reports.
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|