Thema: Delphi Export table rows

Einzelnen Beitrag anzeigen

Benutzerbild von sx2008
sx2008

Registriert seit: 16. Feb 2008
Ort: Baden-Württemberg
2.332 Beiträge
 
Delphi 2007 Professional
 
#3

AW: Export table rows

  Alt 22. Sep 2013, 15:04
Delphi-Quellcode:
const BSIZE = 200;

....
CSVExport.Separator := ';'; // moved outside of the loop because we need so set the separator only once
for i := 0 to (tab1.RecordCount div BSIZE) + 1 do
begin
  tab1.Filtered := False;
  // note: lower margin is included and upper margin is excluded
  // 0..199 (200 records)
  // 200..399 (200 records)
  tab1.Filter := 'Cislo_ID >='+ QuotedStr(i*BSIZE) + ' AND Cislo_ID < '+ QuotedStr((i+1)*BSIZE);
  tab1.Filtered := True;
  if tab1.IsEmpty then
    break; // stop export if there are no more records
  CSVExport.FileName := ExtractFilePath(ParamStr(0))+ 'upload/export'+IntToStr(i+1)+'.csv';
  CSVExport.ExportGrid;
end;
fork me on Github

Geändert von sx2008 (23. Sep 2013 um 00:50 Uhr) Grund: bugfix
  Mit Zitat antworten Zitat