Jump to content


Photo

Export UniDBGrid To Excel Without OLE or Excel Application

export excel unidbgrid

  • Please log in to reply
3 replies to this topic

#1 SMARAM

SMARAM

    Member

  • uniGUI Subscriber
  • PipPip
  • 16 posts

Posted 26 April 2018 - 11:05 PM

Hi,

 

As the title says, I converted a library that Mike Heydon made to export a DataSet to old format Excel file (xls) without OLE or Excel installed.

This library now converts an UniDBGrid to Excel.

 

Sample of usage. 

//  Add uses UExportExcel

procedure TMainForm.UniButton1Click(Sender: TObject);
var url, filename, reportname : String;
    exportExcel: TDataSetToExcel;
    i: integer;
begin
	reportname := 'ExcelReport';
	url := UniServerModule.LocalCacheURL+name+'.xls';
	filename := UniServerModule.NewCacheFileUrl(false, 'xls', reportname, '', url);

	exportExcel := TDataSetToExcel.Create(filename);
  exportExcel.Grid := UniDBGrid1;
  exportExcel.WriteFile;
  FreeAndNil(exportExcel);
  UniSession.SendFile(filename, reportname+'.xls');
end;

Hope it helps everyone. 

Attached Files


  • 2

#2 mohammad

mohammad

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 835 posts
  • LocationKufur Kassem, Palestine

Posted 29 April 2018 - 07:24 PM

We use TMS FlexCel https://www.tmssoftw...ite/flexcel.asp to do that and it works great :-)


  • 0

#3 Bresler

Bresler

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 156 posts
  • LocationCuba

Posted 30 April 2018 - 05:30 PM

Hi Smaram, thanks for share!


  • 0

#4 Beginner

Beginner

    Active Member

  • Banned
  • PipPipPip
  • 91 posts

Posted 04 June 2018 - 10:03 AM

Unidbgrid with summary total how can i export to excel?


  • 0





Also tagged with one or more of these keywords: export, excel, unidbgrid

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users