Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 24th, 2005, 02:27 PM
Registered User
 
Join Date: Oct 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.
__________________
Thanks.

Thanks
 
Old October 26th, 2005, 12:53 PM
Authorized User
 
Join Date: Dec 2004
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 );
x;





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.