Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Changing Parameter from Single to Multiple – Formu Post Reply Post New Topic
Author Message
cruser2
Newbie
Newbie


Joined: 07 Feb 2012
Online Status: Offline
Posts: 14
Quote cruser2 Replybullet Topic: Changing Parameter from Single to Multiple – Formu
    Posted: 08 Feb 2012 at 2:24am

Hi, I am changing an input parameter on an existing report from single value to a multiple values.  I am doing this by changing the Edit Parameter Option Value of Allow multiple values from False to True. When I then run the report I select say three values for the multiple parameter. However there is then an error before the report completes. The Formula Workshop – Formula Editor windows comes up with an error “A string is Required here”. The code is Local numberVar nColonPos;

 

nColonPos := Instr({?Award},":");

 

if nColonPos > 1 then

    left({?Award}, nColonPos -1)

else

    "???"

This code is to just return the string part before the colon character (:) .

Because the parameter is now a multiple list do I have to change this code to handle some type of array?  

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 08 Feb 2012 at 3:18am
if you want to process all the selected parameter values, you need to check the array.  It is the same name, it is now just an array.
if you want to check if a value is in the array, you can use the IN function, like:
if "xxx" in {?Award} then....
 
if you need to process each value, you will need to loop.  I would think you can use a FOR loop like:
local numbervar ind;
local numbervar dne := ubound({?Award});
for ind := 1 to dne Do
(//process using {?Award}[ind] style notation.
);
 
I'm not sure that you can the value of the array member...I don't see why not, but I'm not sure as I haven't tried this myself.
 
HTH
 


Edited by lockwelle - 08 Feb 2012 at 3:19am
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.029 seconds.