Code: Select all
procedure TestExport;
var XLS: TXLSReadWriteII5;
XLSDbRead: TXLSDbRead5;
v: TExcelVersion;
begin
XLS:=TXLSReadWriteII5.Create(Self);
with XLS do begin
Version := xvExcel2007;
XLS.Filename:='D:\TMP_EXCEL\Mn.xlsx';
DirectRead := False;
DirectWrite := False;
XLS.Add;
//XLS.Sheets[0].AsString[0, 0] := 'test 1';
//XLS.Sheets[0].AsString[0, 1] := 'test 2';
//XLS.Sheets[0].AsString[1, 0] := 'test 3';
//XLS.Write;
end;
XLSDbRead:=TXLSDbRead5.Create(Self);
with XLSDbRead do begin
Dataset := AmountQry;
IncludeFieldnames := True;
IndentDetailTables := True;
ReadDetailTables := True;
FormatCells := False;
Row := 0;
Sheet := 0;
XLS := XLS;
end;
XLSDbRead.Read;
XLS.Write;
end;