Dynamic delivery to multiple e-mail recipients

For this example, you will need to create a report book and enable it for dynamic delivery. You will also need to create a scheduled task.

See these topics:

Typically, you will use dynamic delivery to deliver a report book to multiple email recipients. To achieve this, you could use a combo box, the listresult property and a GETPROPERTYVALUES function.

The listresult property returns all elements of a list and their properties as an xml table. You can use GETPROPERTYVALUES to extract all values of a specified property from an XML variable. In this example, it extracts the email address.

Imagine that you have a database dimension which contains a list of staff members. The email address of each member of staff is held as an attribute called EmailAddress.

  1. Create a report and name it DeliveryDriver.
  2. Place a combo box in the report and name it lv_recipients.
  3. In the List Designer, enable the EmailAddress attribute of the staff members dimension.
  4. Populate the combo box with the staff members dimension.
  5. Create a report book.
  6. Select Enable dynamic delivery on the General tab of the report book.
  7. On the Reports tab, make DeliveryDriver the first report in the Report List.
  8. Select DeliveryDriver in the Report List and click Delivery Report
    The Report Parameters section displays the combo box of the DeliveryDriver report.
    Note: If the Delivery Report button is disabled, ensure that you have enabled dynamic delivery on the General tab.
  9. Click the Deliver By checkbox of the combo box.
    A report will be created and delivered in respect of specified elements in the combo box.
  10. In the Elements column of the Report Parameters section, specify the elements in respect of which reports will be generated.

    By default, Automatic is selected - a report will be generated in respect of the element which is currently selected in the list. If you select All Elements, a report will be generated, and a separate mail sent, for each element in the list. This can result in a large number of reports. To generate reports in respect of two or more list elements, select Selection and specify the elements in the Select Elements dialog.

  11. In the Report Catalog, right-click DeliveryDriver and select Report Actions.
  12. Select Deliver report book as the Type.
  13. Select When [report book name] is printed as the Mode of the Deliver report book action.
  14. Specify =GETPROPERTYVALUES(ReportObjects.lv_Recipients.List.ListResult," EmailAddress",";") as the value of the Email to input of the action.
  15. Create and enable a scheduled task to export the report book.
  16. Click the Email tab of the scheduled task.
  17. Click Send email and Attach report.
  18. Click Use dynamic recipient list..
  19. Specify a subject of the email.
  20. Specify the time at which the scheduled task will execute.