Changing Styles Changing a Format Mask

Customizing Reports with XML 22-9 ■ Creating Cross-Product Matrix Groups ■ Creating Formulas, Summaries, and Placeholders at Any Level ■ Creating Parameters This section provides examples of these uses of XML. In addition to these data model types, Oracle Reports Services provides support for using PLSQL in your XML. This includes support for local program units, report-level triggers, and attached PLSQL libraries.

22.3.1 Creating Multiple Data Sources

The data tag now supports the creation of multiple data sources as well as the new pluggable data sources. Each data source is enclosed within its own dataSource tag. The data type definition for the dataSource element is: ELEMENT dataSource select|plugin|plsql, comment?, displayInfo?, formula, group ATTLIST dataSource name CDATA IMPLIED defaultGroupName CDATA IMPLIED maximumRowsToFetch CDATA IMPLIED The following example creates two SQL data sources and names them Q_1 and Q_2. It also creates all the necessary columns for the data sources and the default group—giving the group the specified defaultGroupName or defaulting its own name if defaultGroupName is not specified. report name=anyname DTDVersion=9.0.2.0.0 data dataSource name=Q_1 defaultGroupName=G_DEPARTMENTS select select from departments select dataSource dataSource name=Q_2 defaultGroupName=G_EMPLOYEES select select from employees select dataSource data report

22.3.2 Linking Between Data Sources

In the presence of multiple data sources, it may be desirable to link the data sources together to create the appropriate data model. Oracle Reports data model link objects have also been exposed through Oracle Reports XML. They support both group- and column-level links. You can specify any number of links to create the required data model. The data type definition for the link element is: ELEMENT link EMPTY ATTLIST link name CDATA IMPLIED 22-10 Publishing Reports to the Web with Oracle Reports Services parentGroup CDATA IMPLIED parentColumn CDATA IMPLIED childQuery CDATA IMPLIED childColumn CDATA IMPLIED condition eq|lt|neq|gt|gteq|like|notLike eq sqlClause startWith|having|where where The link element is placed within a data element and can link any two dataSource objects defined within the data element. For example: report name=anyname DTDVersion=9.0.2.0.0 data dataSource name=Q_1 defaultGroupName=G_DEPARTMENTS select select from departments select dataSource dataSource name=Q_2 defaultGroupName=G_EMPLOYEES select select from employees select dataSource link name=L_1 parentGroup=G_DEPARTMENTS parentColumn=DEPARTMENT_ID childQuery=Q_2 childColumn=DEPARTMENT_ID1 condition=eq sqlClause=where data report Within the link element, Oracle Reports defaulting mechanism recognizes DEPARTMENT_ID1 as an alias to the DEPARTMENT_ID column in the EMPLOYEES table without your having to explicitly create such an alias.

22.3.3 Creating Group Hierarchies Within Each Data Source

With Oracle Reports Services, the complete group hierarchy is available to you. You can specify all the columns within each group and break the order of those columns. You can use formulas, summaries, and placeholders to further customize the objects within groups. The data type definition for the group element is: ELEMENT group field|exception|rowDelimiter|xmlSettings|displayInfo|dataItem|formula| summary|placeholder|filter|comment ATTLIST group name CDATA IMPLIED fillColor CDATA IMPLIED lineColor CDATA IMPLIED formatTrigger CDATA IMPLIED The following example demonstrates the use of a group element to create a break group under a data source. report name=anyname DTDVersion=9.0.2.0.0 data dataSource name=Q_1 select select from employees select group name=G_DEPARTMENTS dataItem name=DEPARTMENT_ID