Route Reports based on Content
There is support in the Info Services framework route formatted reports based on content in the report and also to be able to control the paper tray for different types of pages (first, last and rest) in a report when printing. This functionality is only available for print jobs handled by the Report Formatter. Furthermore, the only thing that's included in standard is the framework to make the routing possible. The entire routing (i.e. rules for controlling where a certain report should be sent, what paper tray options to use and so on) is considered business logic and needs to be developed separately in each customer project and handled as a customization.
The new functionality enables you to do the following things:
- Route reports to three different channels based on what ever criteria you'd like. These channels are print, e-mail and other connector.
- It enables you to control the paper tray selection when doing a physical printout (i.e. using the print channel)
- Its support duplex printing (i.e. using the print channel)
- PDF insert and merging. (i.e. using the print channel)
You can specify inserts for the first last and rest pages. The default location of the inserts is after each page, but you can also specify the insert to be placed before the page (see example below). Read more about Report PDF insert.
The way to enable this and start using it is to customize the Route_Print_Job method in the Print_Job_API (i.e. add the appropriate call to you own customized routing code). This Route_Print_Job method is invoked when the status of the print job is set to waiting. This means any routing information will be added before it's picked up and processed by the Report Formatter. The task of the routing code is to update the routing_info column in the print_job_tab table. This column holds a CLOB which needs to be a well formatted XML message according to the below definition.
Here you can see the structure of the routing info (i.e. the type of XML your routing code needs to assemble). Further guidance and instructions can be found below.
<MAIL_SUBJECT>Order Confirmation from Ferrari</MAIL_SUBJECT>
<MAIL_BODY>Dear Mr Olsson,
Attached you'll find the order confirmation of your
Ferrari Enzo. Don't hesitate to contact us if you
have any questions or inquiries.
Thank you for your order</MAIL_BODY>
This sample shows how to route the reports in a print job to all three supported channels simultaneously. The XML structure should be pretty intuitive. A root element called REPORT_ROUTING, containing any number of DESTINATION elements. Each destination must have a CHANNEL and an ADDRESS element (i.e. those are mandatory). For the OTHER channel the CONNECTOR_INSTANCE element is also mandatory.
|XML Element||other connector|
|OMIT_PRINTOUT_TO_JOB_PRINTER||TRUE or FALSE
If it is TRUE then it will skip the printout to the job printer if we’re successful in printing to any of the routing printers.
|CHANNEL||Fixed value: PRINT||Fixed value: EMAIL||Fixed value: OTHER|
|ADDRESS||A logical printer name||A valid e-mail address||The name of the other connector|
|CONNECTOR_INSTANCE||n/a||n/a||The connector instance name|
|OPTIONS||An optional collective element. Three valid options inside: TRAY_FIRST, TRAY_LAST and TRAY_REST||An optional collective element. Four valid options inside: MAIL_SUBJECT, MAIL_BODY, ATTACHMENT_NAME and SEND_CC_TO||Then entire contents of this element will be sent to the connector as the application message address. This structure needs to match the one of the connector (i.e. the connector is responsible for interpreting and using the information included here)|
|TRAY_FIRST||The printer paper tray to use for the first page.||n/a||n/a|
|TRAY_LAST||The printer paper tray to use for the last page||n/a||n/a|
|TRAY_REST||The printer paper tray to use for the all other pages (not being the first or last page)||n/a||n/a|
|COPIES||Number of copies from routing printer|
|DUPLEX_MODE||One of three values can be specified SIMPLEX, DUPLEX_VERTICAL or DUPLEX_HORIZONTAL||n/a||n/a|
|INSERTS||An optional collective element. Three valid Inserts inside: INSERT_FIRST, INSERT_REST and INSERT_LAST with location attributes||n/a||n/a|
|INSERT_FIRST||This will insert the specified pdf document before or after (according to its location attribute, if location attribute not specified then the default location is after) the first page of the report||n/a||n/a|
|INSERT_LAST||This will insert the specified pdf document before or after (according to its location attribute) the last page of the report||n/a||n/a|
|INSERT_REST||This will insert the specified pdf document before or after (according to its location attribute) the all other pages of the report||n/a||n/a|
|SEND_FROM||n/a||Sender's email address. This should be a valid email address.||n/a|
|MAIL_SUBJECT||n/a||Subject of the mail to be sent||n/a|
|MAIL_BODY||n/a||The body of the mail to be sent||n/a|
|ATTACHMENT_NAME||n/a||´The name of the PDF mail attachment. The formatted report (PDF) will be attached to the e-mail using this file name.||n/a|
|SEND_CC_TO||n/a||Any additional mail receivers that should be included in the carbon copy list. Semicolon separated list of e-mail addresses.||n/a|
Report PDF insert
PDFs that are expected to be inserted should be imported via the Solution Manager page.