Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Need help extracting data! Post Reply Post New Topic
Author Message
ChrisJ517
Newbie
Newbie


Joined: 21 May 2007
Online Status: Offline
Posts: 16
Quote ChrisJ517 Replybullet Topic: Need help extracting data!
     Posted: 19 May 2008 at 2:02pm

We have a "Note" field in one of our databases.  Problem is when I use that field in Cystal, it pulls all the font information, etc. as well (see below):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><STYLE type=text/css> P, UL, OL, DL, DIR, MENU, PRE { margin: 0 auto;}</STYLE><META content="MSHTML 6.00.3790.3091" name=GENERATOR></HEAD><BODY leftMargin=1 topMargin=1 rightMargin=1><FONT face=Tahoma size=2><DIV>High Plains Technology</DIV></FONT></BODY></HTML>
 
What I need to is just pull out the data between the two <DIV> .  In this case, I just need to see "High Plains Technology".  Is there a formula I can use to do this?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 19 May 2008 at 3:29pm
Which version of Crystal are you using?  I think this will work in XI, but not earlier versions if the field length is over 255 characters. 
 
Numbervar start;
Numbervar end;
start := InStr({table.notes}, '<DIV>') + 5;
end := InStr({table.notes}, '</DIV>');
mid({table.str}, start, end - start}
 
You may have to tweak the start and end-start calculations to get the right data.
 
-Dell
IP IP Logged
ChrisJ517
Newbie
Newbie


Joined: 21 May 2007
Online Status: Offline
Posts: 16
Quote ChrisJ517 Replybullet Posted: 20 May 2008 at 5:19am
I am using CR XI.  What is table.str?  When I use that, I get an error saying "The Field name is not known"
 
Thanks again...
 
 
Originally posted by hilfy

Which version of Crystal are you using?  I think this will work in XI, but not earlier versions if the field length is over 255 characters. 
 
Numbervar start;
Numbervar end;
start := InStr({table.notes}, '<DIV>') + 5;
end := InStr({table.notes}, '</DIV>');
mid({table.str}, start, end - start}
 
You may have to tweak the start and end-start calculations to get the right data.
 
-Dell
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 20 May 2008 at 10:51am

It should have been "{table.notes}", sorry for the typo!

You need to replace "{table.notes}" with your notes field.
 
-Dell
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