Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Condition Post Reply Post New Topic
Author Message
taniarto
Groupie
Groupie
Avatar

Joined: 15 Oct 2010
Online Status: Offline
Posts: 52
Quote taniarto Replybullet Topic: Condition
     Posted: 26 Oct 2012 at 6:35pm
Dear All,

I Have 2 variables of my report. Those variables will filter the report for selected condition. For example the variables are status and rec. When the status is filled and the rec are filled the report will show the selected criteria. My problems is how to make oppositely like if the criteria is not filled the report can show all the information..

thanks
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 29 Oct 2012 at 6:15am
I assume you're using Parameters for this.  What version of Crystal are you using?
 
I'm not sure whether this feature was available in XI and below, but in 2008 and above, you have the option of marking parameter as Optional.  When you do that and set a default value of "All", you can go to the Select Expert and modify the selection formula to be something like this:
 
({?Status} = 'All' or {MyTable.Status} = {?Status}) and
({?Rec} = 'All' or {MyTable.Rec} = {?Rec})
 
Please note the use of parentheses - this will not work correctly if you don't use them where I've placed them.
 
-Dell
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 29 Oct 2012 at 8:35am
it isnt in XI, so what I usually do is default the value to "ALL"
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