Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Select records from an array Post Reply Post New Topic
Author Message
elafito
Newbie
Newbie


Joined: 26 Apr 2010
Online Status: Offline
Posts: 3
Quote elafito Replybullet Topic: Select records from an array
    Posted: 26 Apr 2010 at 9:43am
Hello,
 
   I have a webproject, where I want receive multiple parameters dynamically. I receive this values in SALES REP in this way (2,34,53,40), so I try to put all this values into an array and then look for them inside the table, but it's giving me this error:
 
"A subscript must be between 1 and the size of the array. Details: errorKind Error in File LE777 {D8EFF973-FF68-48FA-B19E-282729765CDE}.rpt: Error in formula Record_Selection: 'NumberVar ListSize := Count(Split({?SALES REP},"|")); ' A subscript must be between 1 and the size of the array. Details: errorKind " And SALES REP is not empty.
 
This is the code in the Report Selection Expert:
 
NumberVar ListSize := Count(Split({?SALES REP},"|"));
StringVar Array List[ListSize];

NumberVar i;

for i:=1 to ListSize do
(       
        List = Split({?SALES REP},",")
);


{LE10.PRIM_SREP_NUM} in List
 
 
Any idea about how to do this? Is it possible to select records from an array as I am trying to do?
 
Thank you.


Edited by elafito - 26 Apr 2010 at 12:51pm
IP IP Logged
elafito
Newbie
Newbie


Joined: 26 Apr 2010
Online Status: Offline
Posts: 3
Quote elafito Replybullet Posted: 26 Apr 2010 at 10:49am
I solved the error, but looks like not matter if the array is empty or not, I get the same results.
IP IP Logged
elafito
Newbie
Newbie


Joined: 26 Apr 2010
Online Status: Offline
Posts: 3
Quote elafito Replybullet Posted: 27 Apr 2010 at 4:55am
Can I do just: {LE10.PRIM_SREP_NUM} in {?SALES REP} being SALES REP a string like this "55,65,5,12,4,78"?

Edited by elafito - 27 Apr 2010 at 4:55am
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.016 seconds.