setPageOptions

setPageOptions(documentType: Integer;
               orientation:  Integer;
               copies:       Integer;
               topOfPage:    Integer;
               bottomOfPage: Integer;
               leftMargin:   Integer;
               rightMargin:  Integer;
               borderWidth:  Integer;
               collate:      Boolean;
               duplex:       Integer);

The setPageOptions method of the JadeReportWriterReport class sets the Printer class attributes relating to paper size values to be used when running the report and directing output to the default printer.

Use the getPageOptions method to obtain the current paper size values and the setPreviewOptions method to set the preview options that you require.

Your report is output to the current printer. Use the functionality provided by the Printer class (for example, app.printer.setPrinter) to handle the transient instance of the Printer class at run time.

The parameters for the setPageOptions method are listed in the following table.

Parameter Description
documentType Contains the printer form type (for details, see the Printer class documentType property)
orientation Contains the orientation of your printed output (for details, see the Printer class orientation property)
copies Contains the number of copies to be printed (for details, see the Printer class copies property)
topOfPage Contains the margin at the top of the printed page of output (for details, see the Printer class topOfPage property)
bottomOfPage Contains the margin at the bottom of the printed page of output (for details, see the Printer class bottomOfPage property)
leftMargin Contains the left margin of the printed page of output (for details, see the Printer class leftMargin property)
rightMargin Contains the right margin of the printed page of output (for details, see the Printer class rightMargin property)
borderWidth Contains the width of a border that is to be printed around report pages (for details, see the Printer class pageBorderWidth property)
collate Contains the collation setting for print output; that is, whether the copies are printed in proper binding order by separating copies into groups (for details, see the Printer class collate property)
duplex Contains the duplex setting for the report output; that is, the number of sides on which the paper is printed (for details, see the Printer class duplex property)

The following example shows the use of the setPageOptions method.

btnRun_click(btn: Button input) updating;
vars
    jrep                : JadeReportWriterReport;
    strName, strProfile : String;
    intOrient, intIndex : Integer;
    stat, count         : Integer;
begin
    if lstReports.listIndex = -1 then
        return;
    endif;
    strName := lstReports.itemText[lstReports.listIndex];
    jrep := myJWRM.getReport(strName);
    if jrep = null then
        return;
    endif;
    if chkOrientation.value then
        intOrient := 2;          // landscape
    else
        intOrient := 1;          // portrait
    endif;
    intIndex := lstProfiles.listIndex;
    if lstProfiles.listIndex = -1 and lstProfiles.listCount > 0 then
        intIndex := 1;
    endif;
    if intIndex > 0 then
        strProfile := lstProfiles.itemText[intIndex];
        jrep.setProfile(strProfile);
    endif;
    jrep.setPreviewOptions(chkPreview.value, true, false, false,
                           "Printing " & strName);
    jrep.setPageOptions(Print_A4, intOrient, 1, 0, 0, 10, 10, 0, true, 1);
    jrep.run;
end;