Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NULL parameter value

Status
Not open for further replies.

Ofina

Technical User
Feb 25, 2004
156
US
I have a report parameter that allows the user to select some (one or many) invoice numbers to exclude from the generated report.

My problem now is that if the user doesn't want to exclude anything, it is producing an error. We have to sort of add a blank one to be excluded to get it to work.

Though this workaround is fine for the user, I would like it to function properly. I can't find an option in the parameter settings to allow for null.
 
Which version of Crystal are you using? Although I haven't used this feature, in Crystal 2008 there is an option to set a parameter as "Optional" that might work for you.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
CR doesn't allow null parameter values unless your parameter is coming form a parameter in a stored procedure. Optional parameters in CR 2008 and 2011 let you skip a parameter but you have to code the formula to allow optional parameters that are left blank.

If you don't have optional parameters in your version and if your invoice number is stored as a character field you could always put a value in your 'exclude' parameter drop down list that says:

INCLUDE ALL

When the user selects this value the report would run and since this value will never exist as a real invoice number the report won't really exclude anything - showing you all values.


Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
I'm using XI.
That last thing is a good idea. I have made Include All the default. We'll see how it goes.

It's not a drop down though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top