Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Parameter to search for number Post Reply Post New Topic
Author Message
Kwirky
Newbie
Newbie
Avatar

Joined: 21 Apr 2010
Online Status: Offline
Posts: 32
Quote Kwirky Replybullet Topic: Parameter to search for number
     Posted: 10 Aug 2010 at 2:01pm
Hello,
I am trying to create a parameter within a report so that the report will return records which contain a number. I have tried
{PaperEntries.GSM} LIKE [{?PaperLines}]  however it shows the error a string is required.
 
The report is currently giving me a listing of records (sample below) where we are using more than 1 paper line. So far so good. I need to be able to search the report so that I can view all records where one of the paper lines is say 150gsm. This would then show me records 1, 2, 3, and 4 as each of these records shows the 150gsm. I need to have the search find any record that contains the value.
 
Record Description
1 Paper line: 1    150gsm Gloss Artpaper
Paper line: 2    150gsm Gloss Artpaper
Paper line: 3    310gsm Satin Artboard
2 Paper line: 1    Satin Artboard 230
Paper line: 2    Gloss Art 150 gsm
3 Paper line: 1    150gsm Matt Artpaper
Paper line: 2    230gsm Satin Artboard
Paper line: 3    150gsm Matt Artpaper
4 Paper line: 1    310gsm Satin Artboard
Paper line: 2    150gsm Laser Bond
5 Paper line: 1    115gsm Gloss Artpaper
Paper line: 2    230gsm Satin Artboard
Paper line: 3    115gsm Gloss Artpaper
If I search using the description and using *150*, then I get a listing where all the paper lines are 150 and it would not show any of the above records.

Edited by Kwirky - 10 Aug 2010 at 2:02pm
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 11 Aug 2010 at 8:24am
You actually need to use two copies of the same table to get what you're looking for.  Since you didn't give us your table structure, I'm going to make some assumptions:
 
Table Name = PaperEntries
Table Structure = two fields RecordNumber and GSM.
 
1.  Keep your existing table named PaperEntries in the report.  We're going to keep the selection criteria on this table and it will work like the "Master" table in a Master-Detail relationship.
 
2.  Add the PaperEntries table to the report again.  Crystal will tell you that the table already exists and ask if you want to add it with an alias - click on Yes.  The table will appear in the list as "PaperEntries_1".
 
3.  Right-click on the PaperEntries table and select "Rename".  Set the name to "PaperEntries_Master".  Do the same thing on the PaperEntries_1 table, setting the name to "PaperEntries_Detail".  You don't really have to do this step, but I find that it helps me to remember what the report is doing if I have to come back and edit it later.
 
4.  Join from {PaperEntries_Master.RecordNumber} to {PaperEntries_Detail.RecordNumber}.
 
5.  In your Description column on the report, use the data from PaperEntries_Detail so that you get all of the records you're looking for.
 
-Dell
IP IP Logged
Kwirky
Newbie
Newbie
Avatar

Joined: 21 Apr 2010
Online Status: Offline
Posts: 32
Quote Kwirky Replybullet Posted: 11 Aug 2010 at 1:07pm
Hi,
Thank you for your help.
The report works fine now.
 
Kwirky


Edited by Kwirky - 11 Aug 2010 at 1:25pm
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