Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: possible for mulitple arrays for record selection? Post Reply Post New Topic
Author Message
louvaldez
Newbie
Newbie
Avatar

Joined: 06 Jun 2017
Online Status: Offline
Posts: 1
Quote louvaldez Replybullet Topic: possible for mulitple arrays for record selection?
    Posted: 19 Feb 2019 at 8:47am
Good day everyone,

I have a table called customers with a column called AccountNumber and a column called CustomerNumber.  I have a list of over 500 AccountNumber / Customer combinations from a different database that I want to look up in this customer table.

Each account number has a corresponding customer number so the first element in account number array corresponds to the first element in the customer number array, etc...  I want to load the two arrays with the information given and then use a loop to select the right combination. For this example i only included two records...

Is this even possible in crystal?  When i run this code now, it returns every record in the customer table.

whilereadingrecords;
stringvar array AccountNumberArray   := ["041209", "041430"];
numbervar array CustomerNumberArray  := [7741, 4143005];
numbervar indexValue;
numbervar upperBoundValue := ubound(AccountNumberArray);


for indexvalue := 1 to upperBoundValue do
(
    {customers.accountNumber}   = AccountNumberArray[indexValue]
        and
    {customers.customerNumber} = CustomerNumberArray[indexValue];
)


Edited by louvaldez - 19 Feb 2019 at 8:48am
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 26 Feb 2019 at 11:25am
Probably the easiest way to do this would be to put the list into an Excel spreadsheet and then use that as an additional table in your report. By joining from the account number and customer number in the Excel file to the data in your report, you can filter the data in the query instead of having to load and process the arrays.

-Dell
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.027 seconds.