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

Crystal 10 does not allow blank parameters?

Status
Not open for further replies.

xcmuchip

Programmer
May 31, 2001
70
0
0
I have some old Crystal 8.5 reports that are being converted to Crystal 10. The datasource is an SQL Server view. A lot of my reports allow blank parameters. The blank parameter allowed for all records to be shown instead of specific records ("Leave blank for All").

Now when I run the report, I get an error message saying

"Must enter a value for this field"

I do not have a length limit set. The checkbox is unchecked. My selection formula looks like:

Code:
If {?Price Zone} = " " Then TRUE Else {?Price Zone} = {xv_Dart40382.CustClassID}

Are we not allowed to have blank parameters in Crystal 10?

Thanks
 
You can set a default, e.g. "All". If they've tightened up the rules there is probably no choice.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Number fields require a value, string fields do not.

Therefore you may choose to change the parameter to a string prompt and change your selection to:

Code:
If {?Price Zone} = "" Then TRUE Else Val({?Price Zone}) = {xv_Dart40382.CustClassID}

Hope that helps

Steve Phillips, Crystal Trainer/Consultant
 
SMPhillips:

The parameter I am currently using is a string. It looks like the only difference is the Val function you use.

Madawc:

When I didn't hear from anyone right away, I changed one of the reports to use an "All" parameter to get through the error so I could test further. However, I am hoping I don't have to do that to every report.
 
SMPhillips,

I tried your solution. I am getting an error for the Val function because the parameter is an array ("The array must be subscripted").

Is there any other way to allow a blank parameter?

Thanks
 
Can you explain the problem in more detail please? In particular

1. Exactly what parameter settings are you using
a) Datatype?
b) Are multiple values allowed?
c) It it a range of values, discrete etc?

2. What is the datatype of {xv_Dart40382.CustClassID}?

Hopefully then I will be able to help.

Regards,
Steve

Steve Phillips, Crystal Trainer/Consultant
 
I really appreciate everyone's help.

I don't have the option to upgrade CR because it is included with another application, Microsoft Dynamics SL. The version of SL that we are at uses CR 10.

My parameter is a discrete multiple value string. My view field, {xv_Dart40382.CustClassID}, is a char.

Thanks
 
Try setting a default value of blank. I've tried this on v11 and it works fine.

Let us know how you get on.

Steve Phillips, Crystal Trainer/Consultant
 
[q]FYI - CR2008 now allows "Optional" parameters....[/q]
Even 2008 can not handle empty parameter values. I tried to set 'Optional Prompt' option, but that parameter can not be used in any formula.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top