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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to handle NULL parameters from HTML form

Status
Not open for further replies.

keijen

Programmer
Jul 12, 2001
16
AU
I'm new with Crystal ( one week) and I'm tied up here
and would love some help.

An HTML form collects three params from client,
one text, two numeric values captured by the form.
Any one, or two or all three can be null, i.e. if client
selection is for "All" options in any of the three selections
then a null is resented from the form.

In my .rpt file I have three params, text,numeric,numeric,
no default values.

In my Report/Edit Selection Formula/Record I have code as below,
with the intent being to return across ALL Divisions or Status where the client
has indicated a 'don't care' by not selecting in the html form.

Report works fine when the two numeric params receive a value from the html form.
If either param is null, (i.e. client doesn't make a selection), absolutely
nothing turns up in the report.

Changing values or output from the html form is not an option
- I have to find a solution from within CR.

What do I need to do here to say...
"If this param is null then get all value for this param"

My selection code is (...I'll use IIF later)
// Title is text
(If isnull({?TitleParam})
Then {?TitleParam} = "*"
Else {Projects.Project_title} like '*'+{?TitleParam}+'*')
AND
// Division is numeric
(If isnull({?DivisionParam})
Then True
Else {divisions.divid} = {?DivisionParam})
AND
// Status is numeric
If isnull({?StatusParam})
Then True
Else {status.statid} = {?StatusParam})

TIA
Keith





 
Called off:

OK, I sorted it, but not without some gritting of teeth.

1. Found and switched on the "Convert null field value..." flag in Report Options.

2. Changed the test in the select code to test for a zero for an Access database.

It may not be the best way, I'll return to it, but for now it's correctly reporting as required.

keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top