Help Example:

Code:
Object oExportReportButton is a Button
    Set Label to 'Export Report'
 
    Procedure OnClick
        String sReportId
        drPDFExportOptions PDFExportOptions
 
        Get OpenReport of oReport to sReportId
        If (sReportId <> '') Begin
            // set the export options
            Get DefaultPDFExportOptions of oReport to PDFExportOptions
            Move 'MyPassword' to PDFExportOptions.sOwnerPassword
            Move 'UserPassword' to PDFExportOptions.sUserPassword
            Set pPDFExportOptions of oReport to PDFExportOptions
            Send ExportReport of oReport C_drPDF 'c:\tmp\MyReport.pdf'
            Send CloseReport Of oReport sReportId
        End
    End_Procedure
End_Object
Then Send your email.