Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Suppresing part of a field Post Reply Post New Topic
Author Message
kmundt
Newbie
Newbie


Joined: 26 Jan 2011
Online Status: Offline
Posts: 7
Quote kmundt Replybullet Topic: Suppresing part of a field
     Posted: 25 Feb 2011 at 9:55am

I'm using CR to display data generated in a proprietary program that automatically adds its own time/date/user stamp to the data in the format below including the parenthesis. This stamp is applied like this:

 

 

(mm/dd/yyyy h:mm AM USR)

This is where the data I actually need goes...

 

 

Is there any way to suppress the date/time/user stamp and just have the data I really need? I know there is a trim function (which could work, though the hour is 12hr and given in h or hh depending on the need). Is there any way to eliminate that top line? Keep in mind this is not a time date stamp generated through CR, it comes from another program as text.

 

If not, could someone walk me through the trim function and tell me how to eliminate the 24 left most characters of this detail section?

 
Thanks!
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 28 Feb 2011 at 2:42am
If the parenthesis are in the field, you could use strreverse combined with instr. Here is an example:
 
local stringvar nReverse:=strreverse({table.field});
 
nreverse:=left(nReverse, instr(nreverse, ')')-1);
 
strreverse(nReverse);
 
The -1 may need to be adjusted to a -2 or other depending on how much space is after the ')' and the data you need.
 
Hope that helps.
|< /\ '][' ( )
IP IP Logged
kmundt
Newbie
Newbie


Joined: 26 Jan 2011
Online Status: Offline
Posts: 7
Quote kmundt Replybullet Posted: 28 Feb 2011 at 12:34pm
Thanks for the response. That looked like the perfect solution until I tried it in its environment. The problem is that the data I need is free text and when someone uses ")" in their notes it deletes everything before it.
 
Is there a way to make this more specific? The user ID is always caps (2-3 characters) and there's a space after the right paren.
 
I thought trimming the left characters would work but just realized the date can be single or double digits too (i.e. 1 or 10, 8 or 18, etc) so that won't work.
 
If I could delete everything up to  "AA) " where A is a cap alpha, that might work.


Edited by kmundt - 28 Feb 2011 at 12:55pm
IP IP Logged
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