How to Send a Docentric Basic Report to Multiple Print Destinations

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. At the same time, we want to email this report in the PDF output format to the vendor and also to save the report to Print Archive.

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 Multiple Destinations. 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 Multiple Destinations 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 send the report to the multiple print destinations as required, 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 Suppress a Success Message after Report Execution >>

IN THIS ARTICLE