XLSReadWriteII 4 - .xlsx very slow ?
Posted: Wed Jan 20, 2010 10:12 am
Hi
I'm using version 4.00.29a of XLSReadWriteII4 for Delphi 7. I'm creating an Excel 2007 report dynamically.
Older versions of excel have a row limit of about 65536 rows. My reports would typically have more rows than this - hence the reason for using Excel 2007 and the .xlsx format.
When I create a .xlsx file with say 75 000 rows - and I call XLSReadWriteII4.write it takes very very long to create the file.
Sample code :
procedure TfrmXLS.Button2Click(Sender: TObject);
var
XLS: TXLSReadWriteII4;
i : integer;
begin
XLS := TXLSReadWriteII4.Create(nil);
XLS.Version := xvExcel2007;
try
for i := 0 to 75000 do
begin
XLS.Sheet[0].AsString[0,i] := inttostr(i) + ':' + 'Column1';
XLS.Sheet[0].AsString[1,i] := inttostr(i) + ':' + 'Column2';
XLS.Sheet[0].AsString[2,i] := inttostr(i) + ':' + 'Column3';
XLS.Sheet[0].AsString[3,i] := inttostr(i) + ':' + 'Column4';
end;
XLS.Filename := 'c:\Test.xlsx';
XLS.Write;
finally
XLS.Free;
end;
end;
Am I using the component incorrectly ? Is there any way I can increase the speed at which the xls.write command completes ?
The above example will probably take more than 15 minutes to create the file.
It only seems to take this long when I use XLS.Version := xvExcel2007. If I create a normal .xls file it creates the file much much quicker - but I'm limited to 65000 rows.
Please advise.
Thank you !
I'm using version 4.00.29a of XLSReadWriteII4 for Delphi 7. I'm creating an Excel 2007 report dynamically.
Older versions of excel have a row limit of about 65536 rows. My reports would typically have more rows than this - hence the reason for using Excel 2007 and the .xlsx format.
When I create a .xlsx file with say 75 000 rows - and I call XLSReadWriteII4.write it takes very very long to create the file.
Sample code :
procedure TfrmXLS.Button2Click(Sender: TObject);
var
XLS: TXLSReadWriteII4;
i : integer;
begin
XLS := TXLSReadWriteII4.Create(nil);
XLS.Version := xvExcel2007;
try
for i := 0 to 75000 do
begin
XLS.Sheet[0].AsString[0,i] := inttostr(i) + ':' + 'Column1';
XLS.Sheet[0].AsString[1,i] := inttostr(i) + ':' + 'Column2';
XLS.Sheet[0].AsString[2,i] := inttostr(i) + ':' + 'Column3';
XLS.Sheet[0].AsString[3,i] := inttostr(i) + ':' + 'Column4';
end;
XLS.Filename := 'c:\Test.xlsx';
XLS.Write;
finally
XLS.Free;
end;
end;
Am I using the component incorrectly ? Is there any way I can increase the speed at which the xls.write command completes ?
The above example will probably take more than 15 minutes to create the file.
It only seems to take this long when I use XLS.Version := xvExcel2007. If I create a normal .xls file it creates the file much much quicker - but I'm limited to 65000 rows.
Please advise.
Thank you !