Export to PDF from a stream

edited October 2016 in FastReport 4.0
Hello,

I need to generate a pdf file I get a blank PDF file when I set to False the frxPDFExport1.ShowDialog because I must to do it in background without displaying the DialogBox. Setting that property to True it works. Can you please help for a solution ?

  Stream := TMemoryStream.Create;
  QrySpoolerSTORED_REPORT.SaveToStream(Stream);
  Stream.Position:=0;
  Except
  end;
  frxPDFExport1.ShowDialog:=True;
  frxReport1.PreviewPages.LoadFromStream(Stream);
  frxReport1.PrepareReport(false);

  frxPDFExport1.DefaultPath := 'e:\MyFolder\';
  frxPDFExport1.FileName := 'e:\MyFolder\test.pdf';
  frxReport1.Export(frxPDFExport1);

Thanks

NB: Sorry the subject is wrong it must be "Blank PDF file when exporting" I did not find how to modify it.

Comments

  • edited October 2016
    I mean I get an empty PDF
    Sorry for my english
  • gpigpi
    edited 8:37AM
    Try to comment
    //frxReport1.PrepareReport(false);
    

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.