ReportPro 2 PDF Export
Posted: Wed Jun 08, 2022 8:34 am
Hi,
I know this or similar questions have been asked a lot here. But I couldn't find anything that serves my needs.
What I want to achieve is, to print a ReportPro 2.x document straight to pdf. No Preview Dialog, just set the filename in code and create the pdf file.
That would be just right:
But I am using RpPrinter in my code:
[*]
[*]Some answers are very promising, but I think I am missing something. I am using RpPrinter and not RpReport. Can I convert or migrate?
[*]I tried using a PDFPrinter like Free PDF Printer. But can I set the filename without the Print Dialog? And I must admit, I would prefer a solution without external dependency.
[*]Should I switch to ReportPro3? Does this help with anything? Is there a migration guide, or is migrating quite easy?
I think if someone could point me to the point of how to achieve 1) that would be best.
Thank you very much.
I know this or similar questions have been asked a lot here. But I couldn't find anything that serves my needs.
What I want to achieve is, to print a ReportPro 2.x document straight to pdf. No Preview Dialog, just set the filename in code and create the pdf file.
That would be just right:
Code: Select all
LOCAL oReport AS RpReport
LOCAL cCaption, cMessage AS STRING
oReport := RpReport{SELF, "C:RP2SAMPLESBIT.RPT"}
IF oReport:IsValid
cCaption := "My App Name"
cMessage := "Export to PDF in progress..."
oReport:PrintExport(cCaption, cMessage, #RP_PDF, "myfile.pdf")
ENDIF
oReport:Close()
Code: Select all
Local oReport as RpPrinter
oReport := RpPrinter { oOwner, self }
IF oReport:IsValid
oReport:Print("Report", "PRINT.PRN", "Print", "Printing...", FALSE, FALSE)
ENDIF
[*]Some answers are very promising, but I think I am missing something. I am using RpPrinter and not RpReport. Can I convert or migrate?
[*]I tried using a PDFPrinter like Free PDF Printer. But can I set the filename without the Print Dialog? And I must admit, I would prefer a solution without external dependency.
[*]Should I switch to ReportPro3? Does this help with anything? Is there a migration guide, or is migrating quite easy?
I think if someone could point me to the point of how to achieve 1) that would be best.
Thank you very much.