run

run();

The run method of the JadeReportWriterReport class runs the current report, using the parameter values specified in the set methods.

When the report is run, a call is made to the Object class jadeReportWriterCheck method for each object and the object is reported only if the jadeReportWriterCheck method returns true. Call the run method as the last method that you call following the completion of the setting up of your report requirements. See also the runWithStatus method, which runs the report, displays and refreshes a progress dialog, and returns the success of the report and the page count if the report was output to a printer or the record count if the report was extracted to a file.

The following example shows the use of the run method.

btnRun_click(btn: Button input) updating;
vars
    jrep                : JadeReportWriterReport;
    strName, strProfile : String;
    intOrient, intIndex : 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 := Print_Landscape;
    else
        intOrient := Print_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, false, 1);
    jrep.run;
epilog
    delete jrep;
end;