Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Many Optional Parameter Choices Post Reply Post New Topic
Author Message
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Topic: Many Optional Parameter Choices
     Posted: 12 Oct 2012 at 1:47am
Hi, I am using Crystal Reports 2008. I have 3 parameters in my report. Each one is set up as optional. The end-user should be able to select any of these parameters, or none. Now, I just need a little help putting this together in my selection formulas. I already have one selection criteria:
not ({JOBCODE.JOB_CODE} startswith ["N", "E"]).
My parameters are:
{JOBCODE.EFFECTIVE_DATE}={?Job Code Effective Date} or
{JOBCODE.DESC_DATE}={?Job Description Effective Date} or
{JOBCODE.ACTIVE_FLAG}={?Look Up Inactive Job Codes?
 
Just trying to figure out the right order of each of these in my selection formulas. Appreciate your help!
 


Edited by thummel1 - 12 Oct 2012 at 1:47am
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 12 Oct 2012 at 2:18am
HI
 
Try this :
 
if hasvalue({?Job Code Effective Date}) then
{JOBCODE.EFFECTIVE_DATE}={?Job Code Effective Date}
else true
or
if hasvalue({?Job Description Effective Date}) then
{JOBCODE.DESC_DATE}={?Job Description Effective Date}
else true
or
if hasvalue({?Look Up Inactive Job Codes}) then
{JOBCODE.ACTIVE_FLAG}={?Look Up Inactive Job Codes}
else true
 
Thanks,
Sastry
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 12 Oct 2012 at 3:54am
A better way to do this in the selection criteria is something like this:
 
(hasvalue({?Job Code Effective Date}) and
  {JOBCODE.EFFECTIVE_DATE}={?Job Code Effective Date})
OR
(hasvalue({?Job Description Effective Date}) and
{JOBCODE.DESC_DATE}={?Job Description Effective Date} )
OR
(hasvalue({?Look Up Inactive Job Codes}) and
{JOBCODE.ACTIVE_FLAG}={?Look Up Inactive Job Codes})
 
If you use If..Then syntax in the selection criteria, Crystal will pull ALL of the data into memory and then filter it.  If you use the syntax I described, the filter should be pushed to the database for processing which will be faster as only the data that meets the criteria will be returned to the report.
 
-Dell
 


Edited by hilfy - 12 Oct 2012 at 4:07am
IP IP Logged
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Posted: 12 Oct 2012 at 3:57am
Perfect, thanks Dell. I will try this. The first option did exaclty what you explain above.
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Posted: 12 Oct 2012 at 4:10am
This worked perfect Dell! Thank you!LOL
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
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