Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8828

In Crystal Report How to to have a number data type, multi-select & optional parameter & to display its value on the report if one or more or none of the parameter values are selected ?

$
0
0

Hi,

 

I have to create a number datatype; multi-select & optional parameter and want to display multi selected parameter values on the header.

 

I'm able to do this by placing below code in the formula and this works;

 

WhilePrintingRecords;

    Local NumberVar Array InputNum := {?ParameterName};  

    Local StringVar str := "";

    Local NumberVar strLen := Count (InputNum);

    Local NumberVar i;

            For i := 1 to strLen

            Step + 1

            Do (str := str +', '+ ToText(InputNum [i],0,''));

 

    str [3 to Length(str)]

 

however when none of the parameter value is selected(since its optional) an error message pops “a parameter value selected.” and highlights on the below mentioned formula code:


Local NumberVar Array InputNum := {?ParameterName};  

 

-----------------------

I know that we can have string data type ,optional & multi-select parameter ; below is the code that i have used and it works;

 

IF HASVALUE ({?ParameterName}) THEN  join({?ParameterName},', ')

ELSE 'All Buildings'

 

 

Thus my could anyone please let me know a work around to have a number data type- multiselect & optional parameter & to display its value on the report if one or more or none of the parameter values are selected ?

 

Thank you!


Viewing all articles
Browse latest Browse all 8828

Trending Articles