Skip to content

Emailing Reports

There are several ways you can send a generated report through an Email. You can send it through the Print Dialog, through the Route Report based on Content feature, using the Report Rule Engine and using the PDF_REPORT_CREATED event.

You can send the generated report as an attachment in an Email by selecting the "Email" section and specifying a valid Email address in the address field. The generated report will be Emailed if you print to a Logical Printer, direct print to a Physical Printer or if you preview it. If you only wish to send the Email and not print it, then you can print the report to the "No Printout or IFS PDF Archiver" Logical Printer. One thing to note is that the Email subject, body and the attachment name are predefined by the framework and can not be changed.

Print Dialog

Route Report based on Content

You can Email the generated report using the Route Report based on Content feature by using the channel type EMAIL. Here you have the flexibility of specifying your own Email subject, body and attachment name.

Report Rule Engine

You can use the Route To Connect or Send Email Action Type to send a generated PDF report as an Email. When using Route To Connect Action Type you will have to use the Connector as "Mail". Here you have the flexibility of specifying your own Email subject, body and attachment name.

PDF_REPORT_CREATED event

Using the PDF_REPORT_CREATED event and selecting Email as the Action Type you can send a report to a customer or supplier via Email. Here also you have the flexibility of specifying your own Email subject, body and attachment name.

Create a New Event to Set -Up E-mail

The following is an example of how to setup the event. You can use any available event parameters (PDF_PARAMETER_1 - PDF_PARAMETER_10) you want when setting up the event provided that you have passed the necessary values for the parameters from your application code. Values for the other event parameters such as REPORT_ID, REPORT_TITLE, LANGUAGE_CODE etc. are passed through the framework.

  1. Open IFS Solution Manager.
  2. Select Configurations > Events > New Event Action
  3. In the New Event Action page, select E-mail from the Action Type field.
  4. Select the Event ID as PDF_REPORT_CREATED from the Perform upon Event field and enter the title of the report in the Action Description field.
  5. Select Conditions section and enter the Report ID as the value for PDF_PARAMETER_2

  1. Enter &PDF_PARAMETER_1 in to the To field from the list and enter it as shown in the screen shot below.
  2. In the Subject Field, enter the subject of the email. For example, the name of the report can be entered as subject.

  1. Select the Enable Event Action toggle button in the New Event Action page and save the event.

Steps to add Attachments to the email using event action

  1. Select the relevant event action and click on Add Attachment button.

  1. Enter &PDF_FILE in the File Path field.

Add Default Values for Event Parameters

Defining default values for event parameters of the above PDF_REPORT_CREATED event can be done in Report Definition file (.rdf) of each report. Default values for PDF_PARAMETER_1 to PDF_PARAMETER_10 can be defined this way using interface in PdfReportEventParam logical unit.

Example:

 Pdf_Report_Event_Param_API.New_Parameter ('MODULE_REP', 'PDF_EVENT_PARAM_1', 'STRING', 'someone@test.com');

Pdf_Report_Event_Param_API.New_Parameter ('MODULE_REP', 'PDF_EVENT_PARAM_2', 'STRING', 'MODULE_REP');

When Print Jobs are directly created from an application functionality (such as Releasing a Customer Order), in most cases these parameter values are set from the business logic of the relevant product area & stored in Settings column of the Print Job. The default values added from the above method are overridden by the values of the Print Job Settings.

Default values are used in scenarios such as print via Print Dialog where the Print Job Settings are absent.