i have an array of say customer codes.
i want to pass it to crystal report , so that it shows records of only those customers.
pls hep me as to how to go abt it and what i've to set in crsytal repots ie selection formula etc
thanks
Printable View
i have an array of say customer codes.
i want to pass it to crystal report , so that it shows records of only those customers.
pls hep me as to how to go abt it and what i've to set in crsytal repots ie selection formula etc
thanks
You can't pass an array to Crystal Reports. But you can set the selection formula of the Crystal Report control, so the report selects only those records that matches the elements in the array. You can use this:
where {table.field} is the field that contains customer code.Code:Dim strSelection As String, k As Integer
strSelection = ""
For k = 0 To UBound(varArray) - 1
strSelection = strSelection & " OR {table.field} = " & varArray(k)
Next k
' Cut first ' OR '
strSelection = Right(strSelection, Len(strSelection) - 4)
CrystalReport1.SelectionFormula = strSelection
Hope it works!