Export Excel to stream
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
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;
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