Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9610

Re: Multiple Optional Reports

$
0
0

Instead of using one big long if statement, I would break it down into a statement for each parameter.  I would also take out the "If" construct entirely - when you use it Crystal pulls all of the data into memory and filters it there instead of pushing the filter down to the database.  This assumes that there are three types of values in your parameter lookups:

 

"*" = All data

"Blank" = null data

Database values = specific list of values

 

It would look something like this (pay attention to the parentheses - they're important for getting this to work correctly!):

 

(({?Facility_Name} = "*") or

({?Facility_Name} = "Blank" and IsNull({ada_owner1.bldgName})) or

({ada_owner1.bldgName} in {?Facility_Name}))

 

AND

 

(({?Floor_No} = "*") or

({?Floor_No} = "Blank" and IsNull({ada_location1.floorID})) or

( {ada_location1.floorID} in {?Floor_No}))

 

AND

 

...  one set of statements for each parameter.

 

-Dell


Viewing all articles
Browse latest Browse all 9610

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>