destype Elements of a Distribution XML File

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. Creating Advanced Distributions 20-21 include src=report printer foreach

20.5.2 mail Examples

The examples in this section include: ■ E-Mail with a Whole Report as the Body ■ E-Mail with a Section of a Report as the Body ■ E-Mail with Two Report Sections as the Body ■ E-Mail with External File as Body and Report as Attachment ■ E-Mail with Whole Report and Grouped Sections Attached ■ E-Mail to Relevant Manager and Department

20.5.2.1 E-Mail with a Whole Report as the Body

The report will comprise the content of this e-mail. That is, when recipients open this e-mail, they will see the report. mail id=a5 to=managersmycompany.com subject=Quarterly Report body srcType=report format=html include src=report body mail

20.5.2.2 E-Mail with a Section of a Report as the Body

A section of a report will comprise the content of this e-mail. That is, when recipients open this e-mail, they will see a section of the report. mail id=a6 to=employeesmycompany.com body srcType=report format=html include src=mainSection body mail The subject attribute is not included in this mail element, so the default subject will be used: Mail Sent From amp;Report. At runtime, the variable amp;Report will be replaced with the name of the report.

20.5.2.3 E-Mail with Two Report Sections as the Body

Two sections of a report will comprise the body of this e-mail. That is, when recipients open this e-mail, theyll see two sections, headerSection and mainSection, joined together in one report. mail id=emp_addresses to=employeesmycompany.com subject=Employee Address List body srcType=report format=html include src=headerSection include src=mainSection body mail 20-22 Publishing Reports to the Web with Oracle Reports Services

20.5.2.4 E-Mail with External File as Body and Report as Attachment

The contents of the body for this email will be an external file, and the report will go along as an attachment. The path to the file is expressed differently for Windows and UNIX.

20.5.2.4.1 Windows

mail id=XQRSN to=accountingmycompany.com subject=Salaries body srcType=file include src=c:\mail\body.html body attach format=pdf name=salaries.pdf srcType=report include src=report attach mail

20.5.2.4.2 UNIX

mail id=XQRSN to=accountingmycompany.com subject=Salaries body srcType=file include src=mailbody.html body attach format=pdf name=salaries.pdf srcType=report include src=report attach mail

20.5.2.5 E-Mail with Whole Report and Grouped Sections Attached

In this example, recipients receive one e-mail with multiple attachments: one attachment for each group instance and an additional attachment that contains the entire report. If the report is grouped on department_id and there are four departments, recipients will receive five attachments: one for each department and one whole report. mail id=grx90 to=salesmycompany.com body srcType=textAttached you will find the summary report and breakdown by department of weekly totals. body attach format=rtf name=myAttach.rtf srcType=report include src=report attach foreach attach format=pdf name=myattach.pdf srcType=report instance=this include src=mainSection attach foreach mail

20.5.2.6 E-Mail to Relevant Manager and Department

In this example, the manager for department 10 gets department 10s report; the manager for department 20 gets department 20s report; and so on. For this tag set to be valid, the variable must refer to a column that is included in the repeat on group used with the attached section. That is, if the section repeats on G_department_id, manager must be a column in that group. foreach mail id=mgr1090 to=amp;lt;managergt;mycompany.com attach format=pdf name=attach.pdf srcType=report instance=this include src=mainSection