Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 24th, 2005, 02:27 PM
Registered User
Join Date: Oct 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default formula


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.

Reply With Quote
  #2 (permalink)  
Old October 26th, 2005, 12:53 PM
Authorized User
Join Date: Dec 2004
Location: flushing, ny, USA.
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts

if the formula u pasted is the exact one u wrote then all i can see a missing';' at the end of iCountLeft line and iCountRight line.
try this

Stringvar x ;

numberVar iCountLeft;
numberVar iCountRight;

iCountLeft := InStr ({RemedyDaily.customer_notes},"Requested");
iCountRight := InStrRev ({RemedyDaily.customer_notes},"Requested" ,0 );

x := Left ({RemedyDaily.customer_notes},iCountLeft ) & Chr (13) & Right ({RemedyDaily.customer_notes},iCountRight );
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with formula Juan0214 Access 4 August 1st, 2008 07:25 AM
Help with formula 2 Juan0214 Access 3 July 10th, 2008 06:52 PM
Formula scandalous Access VBA 11 February 27th, 2007 09:49 AM
Help with a formula Corey Access 2 October 20th, 2005 10:48 AM
Formula Ned Pro VB 6 2 September 10th, 2003 10:26 AM

All times are GMT -4. The time now is 10:11 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.