How to Suppress a Success Message after Report Execution

Let’s say that we need to print a currently selected purchase order from the Purchase Orders list page as a report to a DOCX output file to a shared location, e.g. \\share\ on a button click. After the report is saved to the file location, it needs to be opened and the Infolog with the message about successful report execution needs to be suppressed.

Assume that we already developed a Basic report that print a purchase order, including the report template as well. Thus we have the DocPrintPurchOrderPrintReport class as the report Print Report Manager (PRM) class, which defines the report parameters and the Report Menu Item pointing to this class.

Our PRM class contains so far the addParameters() method and the default implementation of the main() method.

Now, use the Report Menu Item with a MenuItemButton form control on the Action Pane of the Purchase Orders list page and label it as Print PO to File. This menu item button inherits Data Source from the list page Action Pane, which is the PurchaseTable form data source. When the Print PO to File button is clicked, the main() method of the report PRM class is invoked. If we leave the default implementation of the main() method as it is, the report dialog form will be shown. In order to suppress the report dialog as well as to suppress the success message about report execution and to fulfill the rest of the above written report requirements, we have to change the implementation of the main() method.

Below is the customized main() method of the report PRM class:

See also

Download the Similar Example >>
How to Run a Docentric Basic Report from Code >>
How to Send a Docentric Basic Report to Multiple Print Destinations >>

IN THIS ARTICLE