printer Elements of a Distribution XML File

Creating Advanced Distributions 20-19 ■ Separate E-Mail for Each Group Instance ■ Separate E-Mails with Separate Sections as Attachments ■ Separate File for Each Section ■ Separate Print Run for Each Report

20.5.1.1 Single E-Mail with Report Groups as Separate Attachments

In this example, each attachment contains the corresponding instance from the header, main, and trailer sections. That is, if the report is grouped on department_id, and the first department is department 10, the first attachment will be a report with header, main, and trailer sections all containing department 10 information. This example is valid only if the header, main, and trailer sections repeat on the same group instance, in this case department_id. mail id=a1 to=managersmycompany.com subject=New Hires foreach attach format=html srcType=report instance=this include src=report attach foreach mail First of all, assume in this example that managersmycompany.com goes to a mailing list that distributes to each department manager. If there are four departments: 10, 20, 30, and 40, the first attachment will contain header, main, and trailer sections corresponding to department 10; the second to 20; and so on. This example will yield one e-mail per recipient, each with four attachments.

20.5.1.2 Separate E-Mail for Each Group Instance

In this example, each recipient will receive a separate e-mail for each grouped report. For example, if the report is grouped on department_id, and there are four departments, one recipient will receive four e-mails, each with a separate departments report attached. foreach mail id=weeklies to=managersmycompany.com attach format=htmlcss srcType=report instance=this include src=mainSection attach mail foreach

20.5.1.3 Separate E-Mails with Separate Sections as Attachments

In this example, different sections repeat on different groups. The distribution is set up so that each recipient will receive a separate e-mail with attachment for each grouped main section and for each grouped trailer section. foreach mail id=a6 to=managersmycompany.com subject=Personnel Reports attach format=pdf name=attach.pdf srcType=report instance=this include src=mainSection attach attach format=rtf name=attach.rtf srcType=report instance=this include src=trailerSection attach mail foreach 20-20 Publishing Reports to the Web with Oracle Reports Services

20.5.1.4 Separate File for Each Section

In this example, a separate file is generated for each group instance. Groups repeat on department_id. Each file is named with the relevant department ID. foreach file id=a10 name=department_amp;lt;department_idgt;.pdf instance=this include src=mainSection file foreach Assuming that there are four departments, 10 through 40, this example will result in the creation of four files, named in turn department_10.pdf, department_ 20.pdf, and so on. The format attribute is not included in the file element because it is not required when the srcType is file or text. It is required when the srcType is report. Oracle Reports 11g Release 1 11.1.1 supports PDF encryption in distribution and bursting of Reports. With this feature, you can secure your Reports output through PDF Security in the following way. foreach file id=a10 name=department_amp;lt;department_idgt;.pdf instance=this property name=pdfuser value=amp;lt;department_idgt; include src=mainSection file foreach To open the generated PDF output, you must provide the password as departmentid.

20.5.1.5 Separate Print Run for Each Report

The way you specify a printer name differs between Windows and UNIX. The first example is for Windows. The second is for UNIX.

20.5.1.5.1 Windows In this example, assuming that the report is grouped on

department_id, a report will be printed for each department. foreach printer id=a7 name=\\server_name\printer_name instance=this include src=report printer foreach

20.5.1.5.2 UNIX In this example, assuming that the report is grouped on

department_id, a report will be printed for each department. foreach printer id=a7 name=printer_alias instance=this Note: If you do not specify unique filenames through the use of variable values see Section 20.3.2 , in this example, each successively created file will overwrite the previously created file. That is, the department.pdf file for department 20 will overwrite the department.pdf file for department 10, and so on, until there is only one file left, department.pdf, with information from the last department report created for example, department 40.