cancel
Showing results for 
Search instead for 
Did you mean: 

printing multiple param - error "parameter has no value" when no value

Former Member
0 Kudos

i have this formula to print multiple parameters in the header and it works :

WhilePrintingRecords;

StringVar Array Input := {?param};

NumberVar howmany:= count (Input);

if howmany > 0 then ', ' + Input [1] +

if howmany > 2 then ', *****'

my problem is when the parameter has no value (it means all records) the report stop with the error "Parameter has no value".

in that case i want to print blank field or 'ALL RECORDS'

do you know how ?

thanks

Ricardo

View Entire Topic
Former Member
0 Kudos

I am assuming you are using Crystal Reports 2008, if so then modify your formula to this:


if hasvalue({?param}) then 
(
 if count({?param}) > 0 then ', ' + {?param} [1] +
 if count({?param}) > 2 then ', *****'
)
else 'ALL RECORDS';

If not CR2008 then try this:


if (count({?My Parameter}) = 1 and {?My Parameter}[1] = '') then 'ALL RECORDS'
else
if count({?My Parameter}) > 0 then 
(
 if count({?My Parameter}) > 0 then ', ' + {?My Parameter} [1] +
 if count({?My Parameter}) > 2 then ', *****'
);

Edited by: Sanjay Kodidine on May 28, 2010 1:00 PM