Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
var
Alist : variant;
begin
AList := VarArrayCreate([0, [COLOR=blue]datacounter - 1[/color], 0, [COLOR=red]11[/color]], varvariant);
//PaymentInfo is my query
PaymentInfo.First;
for i := 0 to datacounter - 1 do
begin
with PaymentInfo do
begin
AList[i, 0] := UpperCase(FieldByName('FIRSTNAME').AsString + ' ' + FieldByName('LASTNAME').AsString);
AList[i, 1] := UpperCase(FieldByName('STREET1').AsString);
AList[i, 2] := UpperCase(FieldByName('STREET2').AsString);
AList[i, 3] := UpperCase(FieldByName('CITY').AsString);
AList[i, 4] := UpperCase(FieldByName('STATE').AsString);
AList[i, 5] := FieldByName('ZIPCODE').AsString;
AList[i, 6] := FieldByName('TOTALHRS').AsString;
AList[i, 7] := FieldByName('TOTHRPAY').AsString;
AList[i, 8] := FieldByName('TOTALMLS').AsString;
AList[i, 9] := FieldByName('TOTMLPAY').AsString;
AList[i, 10] := FieldByName('TOTALPAY').AsString;
Next;
end;
excelapp:= CreateOleObject('Excel.Application');
excelapp.Visible := False;
excelapp.Workbooks.Open('R:\Case Management\JMSv2\Forms\Vouchers.xls');
excelsht := excelapp.WorkSheets.Item['ImportData'];
excelsht.Activate;
[b]//set excel range to size of AList array and transfer array in full[/b]
excelsht.Range[excelsht.Cells.Item[2, 1], excelsht.Cells.Item[datacounter - 1, 11]].Value := AList;
//this is the command to run an excel macro that takes the raw data from the 'ImportData' worksheet and creates the actual information I need to produce
excelapp.Run('Generate_VoucherRpt');
end;