Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: how to give choice of parameter Post Reply Post New Topic
Author Message
RoniDxb
Newbie
Newbie
Avatar

Joined: 02 Sep 2008
Location: United Arab Emirates
Online Status: Offline
Posts: 6
Quote RoniDxb Replybullet Topic: how to give choice of parameter
     Posted: 11 Jun 2015 at 11:28pm
Hi
I have three parameter in my report which are following.

Name
FatherName
BatchNo

Now user can only search by one paramter at a time.
for example by Name , or by fathername or by batch no.

please tell me how to do it.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Jun 2015 at 3:40am
are these list parameters or just free text?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 12 Jun 2015 at 4:11am
Are these dynamic parameters? If they're not, then this is fairly easy:

1. Create a parameter that I'll call "Search Type". This will have a list of static values - Name, FatherName, BatchNo.

2. Create another parameter that I'll call "Search Value". This is where the user will enter the value for the search.

3. In the Select Expert, do something like this (the parentheses are important here!):

(
({?Search Type} = 'Name' and {table.NameField} = {?Search Value}) or
({?Search Type} = 'FatherName' and {table.FatherNameField} = {?Search Value}) or
({?Search Type} = 'BatchNo' and {table.BatchNoField} = {?Search Value})
)

-Dell
IP IP Logged
RoniDxb
Newbie
Newbie
Avatar

Joined: 02 Sep 2008
Location: United Arab Emirates
Online Status: Offline
Posts: 6
Quote RoniDxb Replybullet Posted: 13 Jun 2015 at 1:21am
Actually i want to search by
Name
Name and FatherName
Name And BatchNo
Name and CsNo
FatherName and CsNo
CsNo and BatchNo

but not understanding how to do it in crystal report.


IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 15 Jun 2015 at 4:13am
You'll do something similar to what I outlined above, only you'll add a second "value" parameter and make it optional. If a user selects just "Name" and enters something in the second value parameter, you'll just ignore it.

-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