runWithStatus(dialogForm: Form; dialogMethod: Method; status: Integer output; outputCount: Integer output);
The runWithStatus method of the JadeReportWriterReport class runs the current report, using the parameter values specified in the set methods, displaying the progress dialog form specified in the dialogForm parameter, which is refreshed by the method specified in the dialogMethod parameter.
The dialogForm and dialogMethod parameters are optional. If you set the dialogForm parameter to null, the value of the dialogMethod parameter is ignored and the report is run in the same way as the JadeReportWriterReport class run method, but the values of the status and outputCount parameters are returned.
If you specify a dialogForm and dialogMethod parameter value, the method specified in the dialogMethod parameter must be defined on the form instance specified in the dialogForm parameter and it must have two
Any value returned from the method specified by the dialogMethod parameter is cast as a
If the method specified in the dialogMethod parameter is not defined for the
When the report is run, a call is made to the
Call the runWithStatus method as the last method that you call following the completion of the setting up of your report requirements. (See also the JadeReportWriterReport class run method, which runs the current report without a progress dialog and with no return values.)
When the report has been run, the status parameter contains zero (0) if the report ran successfully, minus 1 (-1) if the report run was cancelled, or the appropriate exception code (for example, error code 15017, or Print_Not_Available, if the specified printer does not match the available printers).
The outputCount parameter contains the page count if the report was output to a printer, or it contains the record count if the report was extracted to a file.
The following example shows the use of the runWithStatus method.
btnRun_click(btn: Button input) updating; vars dialogForm : MyDialogForm; dialogMethod : Method; jrep : JadeReportWriterReport; strName, strProfile : String; intOrient, intIndex : Integer; stat, count : Integer; begin if lstReports.listIndex = -1 then return; endif; create dialogForm transient; dialogMethod := dialogForm.class.getMethod("pageUpdate "); 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; 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, true, ""); jrep.setPageOptions(Print_A4, intOrient, 1, 0, 0, 10, 10, 0, true, 1); jrep.runWithStatus(dialogForm, dialogMethod, stat, count); epilog delete jrep; if dialogForm <> null then dialogForm.unloadForm; endif; end;