Print Page | Close Window

Load and Unload Array

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15059
Printed Date: 05 May 2024 at 4:48pm


Topic: Load and Unload Array
Posted By: ziggy
Subject: Load and Unload Array
Date Posted: 30 Nov 2011 at 1:48pm
New to this
I put this formula in a sub report selecting records with a date in the future
 
shared stringvar array FutureApptList;
Shared numbervar X;
FutureApptList[X]:={Urno}&" "&{ClinicCode};
redim preserve FutureApptList[ubound(FutureApptList)+1];
X:=X+1
 
and this one in
shared stringvar array FutureApptList;
Shared numbervar X;
local numbervar I;
For I := 1 to X do
(FutureApptList)
 
in the main report which should (I thought) simply unload the array into the report - it reutrns "True" and thats all.
 
Plan is to eventually load the array with future records and then as records with past dates are read check to see if they are in the array and flag each with a Yes or No respectivly. - Can't even get the array to unload let alone check it against another list.
 



Replies:
Posted By: lockwelle
Date Posted: 01 Dec 2011 at 2:41am
you need to tell what to do with the array.
 
let's say you want it to display a list of the array values, instead of
for ii:=1 to x do
(FurtureApptList[ii])
 
you would do something like:
local string resList;
for ii:=1 to x do
(resList := resList + chrw(10) + chr(13) + FutureApptList[ii];);
mid(resList, 3)   //skip the first crlf
 
you would think that your code is correct,or that CR would understand it, but I think that arrays can confuse it, as it is not a single value, and CR likes single values (99.99% of all items processed are basically single values)
 
obviously, it is cases like this that are the .01%
 
(yeah, I just made up the percentages)
 
HTH
 


Posted By: hirecrishecom
Date Posted: 04 Dec 2011 at 7:34pm
Choose Components > Generate Job from the main HPL window.
The Generate window appears, as Figure 115 shows.

Click Load/Unload Job in the Generate group.
Select a format for the data file in the Format Type group.
Select a name for the generated components and type it in the Generate Name text box.
This name is used for each of the components that this option creates.

Type the name of the database that you will load or unload in the Database text box or click the down arrow to select a database from the selection list.
Type the name of the table within the database in the Table text box or click the down arrow to select a table from the selection list.
Type the name of a device array in the Device text box or click the down arrow to select a device from the selection list.
If you enter the name of a device (file) instead of a device array, ipload creates a device array of the same name as the unload job and inserts the specified device into that device array.

When you specify a file instead of a device array in the Device text box, ipload makes the following assumptions about the data file:

The file is an ASCII file.
The file uses the same locale as the database.
The file uses a vertical bar (|) for the field delimiter and a new line for the record delimiter.
The fields in the data file are in the same order as the columns of the target table.
Click OK.
Figure 116 shows appropriate ch

-------------
http://www.axistechnolabs.com/programmers/asp-dotnet-programmers.aspx - hire asp.net developers , http://www.axistechnolabs.com/programmers/php-programmers.aspx - hire php developers



Print Page | Close Window