Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exporting data to Excel
#3
I have not tried this in the latest version of IW but here is the flexcell routine that works for us.


procedure fxExportToExcel(ADataSet: TDataSet; const AFileName, ABreakFieldName: string;
AOpenFileInExcel: Boolean = True);
var
lXls: TXlsFile;
begin
//this must be called to run Flexcel in a dll
FlexCelDllInit;
lXls := TXlsFile.Create(True);
try
fxPrepareExcelData( ADataSet, lXls, ABreakFieldName );

// Save to File
lXls.Save( AFileName );

{ Open File in Excel }
if AOpenFileInExcel then
ShellExecute(0, 'open', PCHAR(AFileName), nil, nil, SW_SHOWNORMAL);

ADataSet.First;

finally
lXls.Free;
//this must be called to run Flexcel in a dll
FlexCelDllShutdown;
ADataSet.EnableControls;
end;
end;
Reply


Messages In This Thread
Exporting data to Excel - by Fabrizio Conti - 12-22-2023, 09:32 AM
RE: Exporting data to Excel - by PaulWeem - 12-22-2023, 09:50 AM
RE: Exporting data to Excel - by joelcc - 12-22-2023, 02:22 PM
RE: Exporting data to Excel - by Fabrizio Conti - 12-23-2023, 10:28 AM
RE: Exporting data to Excel - by joelcc - 12-27-2023, 02:57 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)