Print Page | Close Window

Removing a single word of the data

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=11715
Printed Date: 05 May 2024 at 1:30am


Topic: Removing a single word of the data
Posted By: immute
Subject: Removing a single word of the data
Date Posted: 18 Nov 2010 at 1:55pm
Hi, is there a way to remove a single word of the data displayed?

For example: I have a check amount of 1,039.71

It will be : ONE THOUSAND AND THIRTY NINE AND SEVENTY ONE ONLY on the check

I want it to be displayed as: ONE THOUSAND THIRTY NINE AND 71/100 ONLY

Is it possible to remove the "AND" word on the amount but not the last one where the cents is shown?






Replies:
Posted By: lockwelle
Date Posted: 23 Nov 2010 at 8:40am
I'm not sure, if you are processing on the .Net side, I would look for all the occurrance after the last one use a lastIndexOf.
 
In CR, I'm not sure if they have such a function.  You could probably split the line into an array, search from the end to the beginning of the array and replace the offending array values with "", then use the JOIN function to get the string back.  I would probably check for double spaces and replace those with a single space.
 
It may not be optimal, but hopefully it will point you in a direction to a solution.



Print Page | Close Window