Report Design
 Crystal Reports Forum : Crystal Reports .NET 2003 : Report Design
Message Icon Topic: Help parsing an E-mail address Post Reply Post New Topic
Author Message
icheckout
Newbie
Newbie


Joined: 18 Apr 2010
Location: United States
Online Status: Offline
Posts: 15
Quote icheckout Replybullet Topic: Help parsing an E-mail address
    Posted: 05 May 2010 at 9:36am

Thank you for looking at my post.

I am using Crystal 8 and have the following issue:

I have the e-mail address stored as one field.  I need to break it down to be 4 fields (User Name, @, Domain Name, Domain Name Extension)  for a report. Here is an example:

If the e-mail is:

jill@gmail.com

I need to break it apart to the following 4 fields:

Jill      @       gmail       com

I have tried using STRINGVAR but have not been successful with the 4 formulas.

Could someone show me the 4 formulas to break up the e-mail address?

Thank you,

Richard Scott



Edited by icheckout - 05 May 2010 at 9:37am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 06 May 2010 at 3:26am
why 4?  Here is what I would do:
 
local numbervar index := instr({table.field}, "@");
local numbervar dot :=instr(index, {table.field}, ".");
shared stringvar front:=left({table.field}, index-1);
shared stringvar at:=mid({table.field}, 1);
shared stringvar domain:=mid({table.field}, index+1, dot-index);
shared stringvar type :=mid({table.field}, dot+1);
 
 
now you just create the 'access' formulas, which look like:
shared stringvar domain
 
the 'tough' question is where to do this and where is it displayed?  If it is to be displayed in the same section, say detail, I would create a second detail section, move it above the main section and place the first formula in it and suppress the section, then use the display formulas in the main detail section.
 
HTH
IP IP Logged
icheckout
Newbie
Newbie


Joined: 18 Apr 2010
Location: United States
Online Status: Offline
Posts: 15
Quote icheckout Replybullet Posted: 17 May 2010 at 10:12am
Lockwelle,
 
Thank you so much for sending me the code.  I really appreciate it.  You saved me a great deal of time.
 
-Richard Scott
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.