Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Dynamic Parameter Post Reply Post New Topic
Author Message
fusion
Groupie
Groupie


Joined: 12 Nov 2007
Location: United States
Online Status: Offline
Posts: 93
Quote fusion Replybullet Topic: Dynamic Parameter
     Posted: 07 Apr 2008 at 5:55pm
Hello Experts,
My report options are Date and name
If date is selected, user should be able to select a value from the field Start_date (datatype: Datetime). The report should display data for that start_date only
If name is selected, user shoudl be able to select a value from the field
p_name (datatype: text). The report should then show records for that P_name only.
 
I would appreicate any ideas or solution.


Edited by fusion - 07 Apr 2008 at 5:57pm
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 08 Apr 2008 at 10:00am
This can be tough because parameters aren't meant to be an "either/or" option. I would try making both parameters a string. The first one is a drop down that selects "Date" or "Name" option. The second one is an empty text field where they can type in anything they want. If they selected Date, then they need to enter a date. If they selected Name, then they need to enter a name.

In the record selection formula you need to use conditional logic to say, If Date is selected, then test on the Date field. And the same for Name. The pseudo code would be
if param1="Date" then
   CDate(param2)=datefield
else
   param2 = namefield;

Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
fusion
Groupie
Groupie


Joined: 12 Nov 2007
Location: United States
Online Status: Offline
Posts: 93
Quote fusion Replybullet Posted: 08 Apr 2008 at 3:58pm
 Thank you Brian,
I wanted to be able to select a date or a name. Then based on the selection, I should not have to enter values manually but be able to select form the dropdown list. I do not think that this is doable.
 
I talked to the client and they have changed their requirement. So the dynamic parameter option would be date and then name.
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