Export Pdf using frxPdfExport under program control without Preview

Hello,

I am hoping to generate a report and save it to a pdf file without a user interface or the user seeing the preview form.
I can't find the method for frxPDFExport that actually creates the pdf file.

Something like:
  DataMod.frxReport1.LoadFromFile(ReportFile, true);
  PdfFile := ExtractFilePath(ParamStr(0)) + 'Report.pdf';

  SetBaselineVariables;

  DataMod.frxReport1.PrepareReport(true);
  //DataMod.frxReport1.ShowPreparedReport;
  DataMod.frxPDFExport1.Report := DataMod.frxReport1;
  DataMod.frxPDFExport1.FileName := ReportFile;
  DataMod.frxPDFExport1. ?

Thanks.

Hardee Mahoney
Washington DC

Comments

  • gpigpi
    edited 7:55PM
    DataMod.frxReport1.LoadFromFile(ReportFile, true);
      PdfFile := ExtractFilePath(ParamStr(0)) + 'Report.pdf';
    
      SetBaselineVariables;
    
      DataMod.frxReport1.PrepareReport(true);
      //DataMod.frxReport1.ShowPreparedReport;
      //DataMod.frxPDFExport1.Report := DataMod.frxReport1;
      DataMod.frxPDFExport1.FileName := ReportFile;
      DataMod.frxReport1.Export(DataMod.frxPDFExport1);
    
  • Thanks!

    gpi wrote: »
    DataMod.frxReport1.LoadFromFile(ReportFile, true);
      PdfFile := ExtractFilePath(ParamStr(0)) + 'Report.pdf';
    
      SetBaselineVariables;
    
      DataMod.frxReport1.PrepareReport(true);
      //DataMod.frxReport1.ShowPreparedReport;
      //DataMod.frxPDFExport1.Report := DataMod.frxReport1;
      DataMod.frxPDFExport1.FileName := ReportFile;
      DataMod.frxReport1.Export(DataMod.frxPDFExport1);
    

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.