Report .pdf direct to file

Hi me again,

Is it possible to write a report directly to a file (pdf) without a preview?

Thanks!

Try turning preview on in the template.
In the embeditor, search for SELF.SkipPreview = false
In the first embed point after that, insert

SELF.SkipPreview=true

Hi Thanks,

Somehow it seems read-only, changes are note saved.

Yes.

Include ReportToPDF in the Global Templates (which will include ReportToPDF in each report in the app)

This adds a ‘Report Targets’ tab on the Report Properties dialog (if it doesn’t show up, generate your app again).

For the report you wish to always go to PDF:

Go to the Report Properties dialog and select the ‘Report Targets’ tab.
Change the ‘Report Target:’ drop-down to ‘Other’
Change the ‘Other Target:’ drop-down to PDF

In the ‘Print Preview’ tab, you’ll want to set ‘Runtime skip preview’ to True (don’t turn off ‘Print Preview’ in the General tab).

You may also want to look at the settings on the ReportToPDF extension for the report you are re-targeting to set things like the output file name, etc.

Hi Ben,

Thanks for your answer. In this case the Save as still pops up. I want to write the report direct to disk with a variable file name.

Thanks!

Call the SetFileName method for the PDFReportGenerator class in your report procedure.

Next setting work for me:

REPORT PROPERTIES:

  • general:
    print preview checked
  • report targets:
    report target: Other
    other target: PDF
  • preview options:
    print preview: i use pdf_print variable here

Extensions REPORT TO PDF:

  • report to PDF:
    populate: always
    output name: variable
    file name: my_pdf_name

EMAIL REPORT OUTPUT:

  • general:
    populate conditional
    conditional my_pdf_name<>’’

Of course there if one big problem with this settings, report always go to pdf, i cannot get print when needed although i get print preview. If you put Ask at runtime under Report target you can choose print or email pdf but i need silent email send and print when needed. Any ideas?