Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: CR 9 Text String Question Post Reply Post New Topic
Author Message
kc27
Newbie
Newbie


Joined: 19 Sep 2008
Location: United States
Online Status: Offline
Posts: 7
Quote kc27 Replybullet Topic: CR 9 Text String Question
     Posted: 17 Nov 2008 at 1:33pm

Hello All

I have field in my report that consists of project names. I would like to exclude any projects from my report that include the word "insert" and/or "stitch" as part of their name.
 
I've tried to use the "Select Expert" tool to accomplish this, but have had no luck. From searches of this forum, I believe I need to utilize a forumula when using the Select Expert tool, and gave it a shot based on some previous answers in this forum, but they did not work. Can someone give me some direction on creating a forumula to exlude projects with insert and/or stitch as part of their name?
 
Thanks in advance for any help on this.
 
 
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 18 Nov 2008 at 12:41am
Hi,
 
In your record selection formula check for if the project names are insert and stitch the below will work
 
not({table.projectnames} in['insert','stitch'])
 
If insert and stitch are part of the names you can try
 
not({Customer.Customer Name} like 'insert*')
and
not({Customer.Customer Name} like 'stitch*')
 
 if  insert and stitch appear only in begining then the above code will work .....
 
if  the words appear in any part use the below
 
Create Two formulas to check for the word
 
Frm1
len({table.projectname}) - len(replace({table.projectname},'Insert',''))
 
Frm2
len({table.projectname}) - len(replace({table.projectname},'Stitch',''))
 
 
Then in record selection formula check
Frm1= 0 and Frm2 = 0
 
 
can you post some sample project names .....
 
Cheers
Rahul


Edited by rahulwalawalkar - 18 Nov 2008 at 12:58am
IP IP Logged
kc27
Newbie
Newbie


Joined: 19 Sep 2008
Location: United States
Online Status: Offline
Posts: 7
Quote kc27 Replybullet Posted: 18 Nov 2008 at 7:32am

Thanks Rahul

My goal is to filter projects with "stitch" or "insert" as part of their description so that they are not included in my report.
 
Here are some examples of the descriptions:
 
Mens Stitch In
September Stitch In - B
Fall Insert 2
Timeline Insert
August Insert Update
 
 
 
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 18 Nov 2008 at 7:34am
Hi
 
if  the words appear in any part use the below
 
Create Two formulas to check for the word
 
Frm1
len({table.projectname}) - len(replace({table.projectname},'Insert',''))
 
Frm2
len({table.projectname}) - len(replace({table.projectname},'Stitch',''))
 
 
Then in record selection formula check
Frm1= 0 and Frm2 = 0
 
Try the above solution should work let me know.........
 
cheers
Rahul
IP IP Logged
kc27
Newbie
Newbie


Joined: 19 Sep 2008
Location: United States
Online Status: Offline
Posts: 7
Quote kc27 Replybullet Posted: 19 Nov 2008 at 7:50am
Hello Rahul
 
Thanks for your help. I've worked on it yesterday and this morning, but still no luck - I am stuck. Here is what I have done.
 
Created a formula named "stitch". The user decided they wanted to include projects with "insert" in their descritpion, so I only need to filter out those projects with "stitch" in their description
 
Your example was:
len({table.projectname}) - len(replace({table.projectname},'Stitch',''))
 
The formula I created is called "stitch" and its syntax is below:
len({ad_info.ad_desc}) - len(replace({ad_info.ad_desc},'stitch',''))
 
I was not sure what "projectname" referred to - I thought it was the field that had to be filtered.
 
Record Selection Step
The next step was to do the following... 
"Then in record selection formula check
Frm1= 0 and Frm2 = 0"
 
I went to the "Report" pull-down menu and chose "Report > "Selection Formulas" From there I do not see how to check "stitch = 0"
 
Any ideas on what I am doing incorrectly?
 
 
 
 
 
 
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 19 Nov 2008 at 8:01am
Hi
 
Go to Report Menu then Selection Formula then select Record
 
Once done you will see report fields node  and database nodes on top expand report fields node their you will see your stitch formula double click it will appear in bottom window
 
their you check stitch = 0
 
cheers
Rahul
IP IP Logged
kc27
Newbie
Newbie


Joined: 19 Sep 2008
Location: United States
Online Status: Offline
Posts: 7
Quote kc27 Replybullet Posted: 19 Nov 2008 at 8:23am
Rahul
 
OK - I am a lot closer
 
 
I double clicked the stitch formula and it added
 
{@stitch} to the top of the formula in the lower section

I am not sure what you meant by "their you check stitch = 0" but I changed the stitch formula in the lower section to read:
 
{@stitch} = 0 and
 
I checked, the code, no errors were found, I refreshed the report. It still lists projects that contain "stitch" in their description.
 
 
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 19 Nov 2008 at 9:19am
Hi
 
Go it the word you are searching for is Stitch ..... and in your formula you are checking stitch.....
 
so change the text in your formula from stitch to Stitch
 
cheers
Rahul
IP IP Logged
kc27
Newbie
Newbie


Joined: 19 Sep 2008
Location: United States
Online Status: Offline
Posts: 7
Quote kc27 Replybullet Posted: 25 Nov 2008 at 8:44am
Got it working, thanks!
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