I've created my first report using DF Report v 3. I wanted to have the report automatically export to PDF & in the help found the below sample:
Code:
Object oReport is a cVRWReport
Set psReportName to 'MyReport.vrw'
End_Object
Object oExportReportButton is a Button
Set Label to 'Export Report'
Procedure OnClick
vrwPDFExportOptions PDFExportOptions
// set the export options
Move C_vrwNormal to PDFExportOptions.iPageMode
Move 'MyPassword' to PDFExportOptions.sOwnerPassword
Move 'UserPassword' to PDFExportOptions.sUserPassword
Move C_vrwLow to PDFExportOptions.iImageQuality
Set pPDFExportOptions of oReport to PDFExportOptions
// exports the report to a file MyReport.PDF
Send ExportReport of oReport C_vrwPDF 'MyReport.PDF'
End_Procedure
End_Object
The line Set pPDFExportOptions of oReport to PDFExportOptions was generating an error "Visual Report Writer error. No Report ID specified, Report was not opened?". I've since added:
Code:
Get OpenReport of oReport to sReportId
If (sReportID <> "") Begin
Set pPDFExportOptions of oReport to PDFExportOptions
Send ExportReport of oReport C_vrwPDF sFileName
End
I found a sample like the above on the OpenReport help page. This now makes the report work but should I be doing something else or is the help in need of an update?
Thanks,
Gerry