Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Parameters & Arrays Post Reply Post New Topic
Author Message
chrispfeiffer
Newbie
Newbie


Joined: 24 Jun 2009
Location: United Kingdom
Online Status: Offline
Posts: 9
Quote chrispfeiffer Replybullet Topic: Parameters & Arrays
     Posted: 08 Jul 2013 at 3:49am
I need to use the 'allow multiple values' option for a user to enter up to five alpha-numeric Customer IDs. The parameter works fine with just the discreet option allowed but when 'allow multiple values' is selected the error message of 'this array must be subscripted. For example: Array [1]' appears.

I then see you cannot create an array through a formula so what needs to be done with the Customer ID field to 'allow multiple values' to function?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 09 Jul 2013 at 4:53am
this is my understanding of allow multiple values...you would have to provide a list of the customerID field for the user to select from. If you have already done that, then the logic to use the values would be something like:
{table.customerID} in {?customerIDParameter}
or
you could iterate through the array like:
local numbervar x;
for x := 1 to UBOUND({?customerIDParameter}) do
(
if {?customerIDParameter}[x] = {table.customerID} then
    do something
else
    do something else
)

HTH
IP IP Logged
chrispfeiffer
Newbie
Newbie


Joined: 24 Jun 2009
Location: United Kingdom
Online Status: Offline
Posts: 9
Quote chrispfeiffer Replybullet Posted: 11 Jul 2013 at 11:45pm
Thank you for that. I'll give it a try
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum