cancel
Showing results for 
Search instead for 
Did you mean: 

Paramater Values when the filed has no value

Former Member
0 Kudos

I am using dynamic paramaters with multiple values to select records in my reports. There are occasions when the field is not populated so there is a blank row in the available values list, but I cannot select the blank value. I need to be able to select all records with blank values in the field. How can I do this?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

That would work, although I would like to be able to leave the paramater value blank and get all records, or select one or more paramaters to filter the records. I would like one of the filters to be the blank records. Is there a way to do this?

Former Member
0 Kudos

I needed the same thing - if the field is left blank, select all records; if the field has a value, filter on that value; or some way exclude records with NULL in the value.

I set up 2 parameters; 1 to use as a filter. If it's blank, the report selects all records. If it has a value, the report filters on that value. Then a 2nd parameter that only had one selectable option and a blank default value - for that I used:

(not HasValue({?Exclude Clearanced}) OR ISNULL({OITM.U_ClrCode}))

So if it's blank, the report ignores it, if it's chosen the report only selects the Nulls.

Hope that helps.

Answers (4)

Answers (4)

Former Member
0 Kudos

Crystal 2008

Former Member
0 Kudos

Hi

Select the parametr as Potional Prompt and use this formula in ReportSelect ExpertRecord

If hasvalue({?Parameter}) Then

= {?Parameter} Else =" " or isnull()

Now if leave blank your prarmenter then it will take null values in your repot if you enter any value it will filter based on the value.

Thanks,

Sastry

Former Member
0 Kudos

I'm sorry, I have not been completely clear. I want to have the values dynamically populated when the report is opened. I need to have the option to select all or only one or each value, including blank values.

I cannot use a formula in my paramater. Is there another way to accomplish this?

Thank you.

Former Member
0 Kudos

Hi...

What is the version of crystal reports you are using ?

Thanks,

Sastry

Former Member
0 Kudos

I get the records with null values now, but I can't select the just the records with null values.

Former Member
0 Kudos

Hi sm White,

The parameter values are coming in dropdown from database. You can't assign any values to the database values in the dropdown, insted you can write a formula and place in the report to get the null values records only in your report.

formula

If isnull() or {field| = " " Then

"Blank"

Else

{Field}

In Record selection

{@formula} ="Blank"

This will give only null value records.

Thanks,

Sastry

Former Member
0 Kudos

Try enabling the two checkboxes under File -> Report Options:

1. Convert Database Null values to default

2. Convert Other Null values to default

Try running it afterwards and see how that works.