Hi All,
One of the expert as posted this solution(below) for my problem and it is exactly what I wanted. I but have another little issue when there are two different input list which will read into one database field and is difference can be figure through a another field which is a flag field.
How can I use this formula and reset the rows reading into the arrays when the flag field changes.....
Any help is greatly appericated very much....
Thanks,
Sweetie
Also, the sample only shows using 3 arrays. If your list of accounts was greater than 254 * 3, then you'd need additional array(s).
Create 5 formulas:
Formula: VariableDeclarations
--------------------
BeforeReadingRecords;
global NumberVar x;
global NumberVar y;
global NumberVar z;
global NumberVar w;
Global StringVar Array arCustomerID;
Global StringVar Array arCustomerID2;
Global StringVar Array arCustomerID3;
global NumberVar StringLength;
Formula: CustomerList
---------------------WhileReadingRecords;
Global NumberVar x;
Global NumberVar y;
Global NumberVar z;
Global NumberVar w;
Global StringVar Array arMaster;
Global StringVar Array arCustomerID;
Global StringVar Array arCustomerID2;
Global StringVar Array arCustomerID3;
Local StringVar strCustomerID := Cstr({Customer.Customer ID},"0",0);
Global NumberVar StringLength;
If Not (strCustomerID in arMaster) then
(x := x + 1;
Redim Preserve arMaster[x];
arMaster[x] := CStr({Customer.Customer ID},"0",0);
StringLength := StringLength + Length(strCustomerID) + 1; //add one to allow for comma separation
SELECT StringLength
CASE 0 to 254:
(w := w + 1;
Redim Preserve arCustomerID[w];
arCustomerID[w] := CStr({Customer.Customer ID},"0",0)![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
CASE 255 to 508:
(y := y + 1;
Redim Preserve arCustomerID2[y];
arCustomerID2[y] := CStr({Customer.Customer ID},"0",0)![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
CASE 509 to 782:
(z := z + 1;
Redim Preserve arCustomerID3[z];
arCustomerID3[z] := CStr({Customer.Customer ID},"0",0)![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
DEFAULT:
//do nothing
"0";
)
Formula: ShowArray1
--------------------
whilePrintingRecords;
Global StringVar Array arCustomerID;
Join(arCustomerID, ","![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Formula: ShowArray2
--------------------
whilePrintingRecords;
Global StringVar Array arCustomerID2;
Join(arCustomerID2, ","![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Formula: ShowArray3
--------------------
whilePrintingRecords;
Global StringVar Array arCustomerID3;
Join(arCustomerID3, ","![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Place the first formula in the report header. Put the 2nd Formula in the details section. Create a text box in the report header and place the remaing formulas in the textbox.
One of the expert as posted this solution(below) for my problem and it is exactly what I wanted. I but have another little issue when there are two different input list which will read into one database field and is difference can be figure through a another field which is a flag field.
How can I use this formula and reset the rows reading into the arrays when the flag field changes.....
Any help is greatly appericated very much....
Thanks,
Sweetie
Also, the sample only shows using 3 arrays. If your list of accounts was greater than 254 * 3, then you'd need additional array(s).
Create 5 formulas:
Formula: VariableDeclarations
--------------------
BeforeReadingRecords;
global NumberVar x;
global NumberVar y;
global NumberVar z;
global NumberVar w;
Global StringVar Array arCustomerID;
Global StringVar Array arCustomerID2;
Global StringVar Array arCustomerID3;
global NumberVar StringLength;
Formula: CustomerList
---------------------WhileReadingRecords;
Global NumberVar x;
Global NumberVar y;
Global NumberVar z;
Global NumberVar w;
Global StringVar Array arMaster;
Global StringVar Array arCustomerID;
Global StringVar Array arCustomerID2;
Global StringVar Array arCustomerID3;
Local StringVar strCustomerID := Cstr({Customer.Customer ID},"0",0);
Global NumberVar StringLength;
If Not (strCustomerID in arMaster) then
(x := x + 1;
Redim Preserve arMaster[x];
arMaster[x] := CStr({Customer.Customer ID},"0",0);
StringLength := StringLength + Length(strCustomerID) + 1; //add one to allow for comma separation
SELECT StringLength
CASE 0 to 254:
(w := w + 1;
Redim Preserve arCustomerID[w];
arCustomerID[w] := CStr({Customer.Customer ID},"0",0)
CASE 255 to 508:
(y := y + 1;
Redim Preserve arCustomerID2[y];
arCustomerID2[y] := CStr({Customer.Customer ID},"0",0)
CASE 509 to 782:
(z := z + 1;
Redim Preserve arCustomerID3[z];
arCustomerID3[z] := CStr({Customer.Customer ID},"0",0)
DEFAULT:
//do nothing
"0";
)
Formula: ShowArray1
--------------------
whilePrintingRecords;
Global StringVar Array arCustomerID;
Join(arCustomerID, ","
Formula: ShowArray2
--------------------
whilePrintingRecords;
Global StringVar Array arCustomerID2;
Join(arCustomerID2, ","
Formula: ShowArray3
--------------------
whilePrintingRecords;
Global StringVar Array arCustomerID3;
Join(arCustomerID3, ","
Place the first formula in the report header. Put the 2nd Formula in the details section. Create a text box in the report header and place the remaing formulas in the textbox.