Skip to Content
0
Nov 15 at 05:37 PM

Passing multiple parameter value to non-COMMAND report

101 Views

My values that need to be passed to the report from my third-party reporting software look like this:

232006,232691,233973

The object is to return the records related to those three numbers.

It is all very standard "In" functionality in SQL, and I normally use a COMMAND for all my Crystal Reports for this exact reason: so that when I need to use the report with multiple values, I can just use ....WHERE Table1.Field1 In {MyCommaDelimitedValueListAbove}

But I inherited a very complex report with many formulas, SQL Expressions, etc that refer to fields in the source tales, and it uses linked source tables via the Data/Links dialog, not a COMMAND. I can see already that it will be a major pain to convert it to a COMMAND. The report's SQL query, very simplified, looks like this in Database → Show SQL Query

Select

Table1.Field1,

Table1.Field2,

Table2.Field3

From

Table1

Inner Join

Table2

On

Table2.Field4 = Table1.Field4

But this is not a COMMAND, and I cannot figure out where to call this "Table1.Field1 In [My List Above]. Of course, it works if I create a multi-value parameter and then hard-code those specific numbers in the Select Expert → Formula Editor like this: Table1.Field1 In [232006,232691,233973]. But how do I create a multi-value parameter and add it to the Select Expert? It will not let me do this: Table1.Field1 In [{?MyMultiValueParameter}]. That generates an error that indicates "This array must be subscripted. For example: Array [i]". And if I do Array[{?MyMultiValueParameter}], then it tells me that "A number, currency amount, boolean, date, time, date-time, or string is expected here".

I will continue experimenting and searching here on the forum and elsewhere, but someone may just save me some time and headache if you already know the answer.