Skip to Content
0

Returning multiple records for a numeric parameter.

Mar 24, 2017 at 10:34 PM

30

avatar image

I am using a formula to display multiple records for a numeric parameter. I've found several formulas by searching that work just fine unless the parameter is left blank, my report allows for this so that all records for which the parameter is being used. In that case, I get the message that the "Parameter has no value." Any ideas on how to account for the null parameter?

The formulas below both have the same result; they work unless the parameter is left blank.

NumberVar AcctPmtr;
StringVar Display;
For AcctPmtr := 1 To Count({?Account}) Do (
Display := Display + ToText({?Account}[AcctPmtr],0,"") + ", ");
Left(Display, Len(Display)-2);

________

WhilePrintingRecords;
Local NumberVar Array InputNum := {?Account};
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)]

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Ian Waterman Mar 27, 2017 at 08:10 AM
0

Try something like

Local NumberVar Array InputNum:=0;

if hasvaue( {?Account}) then InputNum;={?Account};

Ian

Share
10 |10000 characters needed characters left characters exceeded