Generate an XLS without using Excel (BIFF)

0

How to generate a .xls file without using Excel? I do not want to use OLE , but I would like to enter the information in binary format, using the BIFF8 structure or something like this.
The problem is that I can not find documentation, not even on the MSDN !

Does anyone know how BIFF8 is structured?
Or do you have any idea how to export a report to Excel without using Excel?

Details:

  • Delphi XE7
  • pReport (Report Builder)
asked by anonymous 26.09.2016 / 16:11

1 answer

1

This could be a solution to your problem, just create a table in html and export as Xls , example:

procedure TForm1.Button1Click(Sender: TObject);
var XlsFile: TextFile;
    i: integer;
begin
  AssignFile(XlsFile, 'C:\report.xls');
  Rewrite(XlsFile);
  writeln(XlsFile, '<HTML><BODY><table>');
  writeln(XlsFile, '<tr><td>Test</td></tr>');
  writeln(XlsFile, '<tr><td>Test</td><td>Test2</td></tr>');
  writeln(XlsFile, '<tr><td>Test</td></tr>');
  writeln(XlsFile, '</table></body></html>');
  CloseFile(XlsFile);
end;

Any question or question, I hope I have helped.

    
03.10.2016 / 11:16