file Elements of a Distribution XML File

Creating Advanced Distributions 20-17 When used with the foreach element and the instance=this attribute, the destype element can distribute each group instance of a grouped report to a separate destype instance for example, a separate fax. For example, if you group a report on department_id, and there are four departments, you can generate four destype instances, each containing a separate departments report. In this case, the destype entry in the distribution XML file might look like this: foreach destype id=a9 name=fax instance=this include src=report property name=number value=amp;lt;fax_numbergt; destype foreach In this example, all report sections header, main, and trailer must repeat on the same group instance for example, fax_number. Custom destination types also have a set of related attributes. These are expressed within the destype tag. For example, the id, name, and instance attributes are expressed: foreach destype id=a1 name=name_of_destination_type instance=all include src=report destype foreach Table 20–8 lists and describes the attributes of the destype element. Note: The inclusion of a custom destination type requires that you have a defined distribution handler in place to push report content to the custom output destination. Build a custom destination type through the Oracle Reports Services Destinations API. For more information on the available APIs for Oracle Reports, refer to the Reports Software Development Kit RSDK on the Oracle Technology Network OTN: on the Oracle Reports page http:www.oracle.comtechnologyproductsreports index.html , click SDK. Table 20–8 Attributes of the destype Element Attribute Valid Values Description id string Required. A keyword, unique within a given distribution XML file, that identifies a particular file element. This can be a combination of a text string and one or more numbers, for example id=a1. The id value must always start with an alpha character. name string Required. The name of the custom destination. For example, for a fax, this might be: name=fax For a portal built with Oracle Portal: name=oraclePortal 20-18 Publishing Reports to the Web with Oracle Reports Services

20.4.10 property

Example foreach destype id=custom1 name=fax instance=all include src=headerSection property name=number value=914925551212 destype foreach RequiredOptional Optional. You can have as many properties as you require under a destype element. Description The property element allows for the inclusion of namevalue pairs expressed in terms recognized by a custom destination type destype . Properties are merely passed along to the destination handler. They serve no function within Oracle Reports Services. How you specify properties is entirely dependent on the requirements of your custom destination.

20.5 Distribution XML File Examples

This section provides examples, from simple to complex, of distribution XML elements. They are organized according to the main distribution.dtd elements: ■ foreach Examples ■ mail Examples ■ file Examples ■ printer Examples ■ destype Examples

20.5.1 foreach Examples

The examples in this section include: ■ Single E-Mail with Report Groups as Separate Attachments instance this|all Default: all Used when the foreach element is also present. With a grouped report that is burst into separate reports, instance specifies whether the groups will be broken into separate destype instances according to each group instance this or all contained within the same destype instance all. For example, if you custom destination type is a fax, instance=this would mean a separate fax for each group instance, and instance=all would mean one fax for all groups. Table 20–8 Cont. Attributes of the destype Element Attribute Valid Values Description 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