I have a comma separated list of locations in the report footer of my report.
This formula is in the details section:
WhilePrintingRecords;
stringvar array locarr;
numbervar i;
if not({AUDIT.LOCATION} in locarr) then
(
i := i + 1;
redim preserve locarr;
locarr := {AUDIT.LOCATION};
);
locarr
And this formula is in the Report Footer:
WhilePrintingRecords;
stringvar array locarr;
stringvar fin;
numbervar j;
numbervar n;
for j := 1 to ubound(locarr) do
fin := fin + locarr[j] + ", ";
left(fin,len(fin)-2);
The problem is that the results are printed in the order they were put into the array. How can I sort the array so that when it prints the results, the locations are in alphabetical order?
Thanks.
This formula is in the details section:
WhilePrintingRecords;
stringvar array locarr;
numbervar i;
if not({AUDIT.LOCATION} in locarr) then
(
i := i + 1;
redim preserve locarr;
locarr := {AUDIT.LOCATION};
);
locarr
And this formula is in the Report Footer:
WhilePrintingRecords;
stringvar array locarr;
stringvar fin;
numbervar j;
numbervar n;
for j := 1 to ubound(locarr) do
fin := fin + locarr[j] + ", ";
left(fin,len(fin)-2);
The problem is that the results are printed in the order they were put into the array. How can I sort the array so that when it prints the results, the locations are in alphabetical order?
Thanks.