Export Excel to stream

edited 8:37AM in FastReport 4.0
Hello,

I'm working on FR 4.15 and Delphi XE5.

I'm trying to export one report to Xls format and save it into a TMemoryStream.
I'have followed the same procedure I used to export the same report to Pdf format into a TMemoryStream but in the case of TfrxXlsExport my stream result empty.

The report is the same and it works well exporting it to Pdf format.
Why the same procedure using TfrxXlsExport result in an empty stream ?

Here is the code :
function TIWUserSession.ExportReport: TMemoryStream;
begin
Result := TMemoryStream.Create;
// Pdf
if (self.FSelectedReport.OutputFormat = Pdf) then begin
self.frxPDFExport.Stream := Result;
self.frxReport.Export(self.frxPDFExport);
end;

// Xls
if (self.FSelectedReport.OutputFormat = Xls) then begin
self.frxXlsExport.Stream := Result;
self.frxReport.Export(self.frxXlsExport);
end;
end;

Thank you,
Davide

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.