Creating a Queue That Holds Messages of Type SRW_PARAMLIST

22 Customizing Reports with XML 22-1 22 Customizing Reports with XML Extensible Markup Language XML is designed to improve the functionality of the Web by providing a method to promote detailed information identification. It is actually a metalanguage a language used for describing other languages and can be used to design customized markup languages for different type of documents. XML documents are composed of both markup and content: ■ Elements are the building blocks of XML. An element instance is a structure that contains tags a main tag and appropriate nested tags, attributes, and the elements content nested between the tags. ■ Tags are used to define the element and the content within it. ■ Attributes provide extra information for each tag. XML customizations enable you to modify reports at runtime without changing the original report. With the addition of the CUSTOMIZE keyword to your runtime command line, you can call a customization file to add to or change a reports layout or data model. One XML customization file can perform all of these tasks or any combination of them. You can even use XML to build a report data model for inclusion in a custom JSP-based report. By creating and applying different XML customizations, you can alter the report output on a per user or per user group basis. You can use the same report to generate different output depending upon the audience. When you apply an XML customization to a report, you have the option of saving the combined definition to a file. As a result, you can use XML customizations to make batch updates to existing reports. You can quickly update a large number of reports without having to open each file in Oracle Reports Builder. Oracle Reports Services extends the possible types of Oracle Reports XML customizations by enabling you to create an entire reports data model in XML. This includes the creation of multiple data sources, linking between data sources, and group hierarchies within each data source. Data model support through Oracle Reports XML customization means that any data model that can be created with Oracle Reports Builder can now be created by specifying XML. Additionally, all properties that can be set against data model objects can now be set using XML. This chapter discusses the ways you can use XML to customize reports on the fly and to build data models. It includes the following sections: ■ Customization Overview ■ Creating XML Customizations ■ Creating XML Data Models 22-2 Publishing Reports to the Web with Oracle Reports Services ■ Using XML Files at Runtime ■ Debugging XML Report Definitions This chapter lists and provides examples of the supported elements in the reports.dtd file. However, only some of the attributes of these elements are listed. For more information, either on the additional attributes or on the Oracle Reports XML elements, tags, and attributes, refer to the following sources: ■ The reports.dtd file lists all the Oracle Reports XML elements, tags, and attributes and, where present, the attributes default values. The reports.dtd file is located in ORACLE_HOME\reports\dtd\ on both Windows and UNIX platforms. Many of the sub-elements include symbols that denote usage rules. For example: ■ A plus sign + means you can have one or more of this type of element in your XML file. ■ An asterisk means you can have from zero to many of this type of element in your XML file. ■ A question mark ? means you can have either zero or one of this type of element in your XML file. ■ No mark means the element is required, and you can have one and only one of this type of element in your XML file. If multiple sub-elements are enclosed in parentheses and followed by a symbol, the symbol applies to all enclosed sub-elements. ■ For descriptions of selected Oracle Reports XML tags, see topic Oracle Reports XML tags in the Reference section of the Oracle Reports online Help. ■ Build a report that includes the type of customization you are trying to build, save the report as XML, and view the saved file in a text editor. This provides an excellent means of seeing Oracle Reports XML in action and provides you with examples of the more complex models you may wish to build. Customizing Reports with XML 22-3

22.1 Customization Overview

By using the Oracle Reports XML tags, you can customize reports created using Oracle Reports Builder. Creating and applying an XML customization is a three-step process: 1. Create a customization file using Oracle Reports XML tags. You can create this customization by building a report using Oracle Reports Builder then saving your report as XML. You can also build the customization manually, with any sort of text editor or a sophisticated XML editor, as long as you include the XML tags that are required for the particular Oracle Reports customization. 2. Store the XML customization in a location that is accessible to Oracle Reports Services. 3. Apply the XML customization to another report with the CUSTOMIZE command line keyword or the SRW.APPLY_DEFINITION built-in procedure, or run the XML customization by itself if it contains a complete report definition with the REPORT or MODULE command line keyword. Note: For reports developed in a release prior to Oracle Reports 10g Release 2 10.1.2 patch 2, you may find the PLSQL package specification or body is missing when opening the XML reports. In this case, either: If the RDF exists, regenerate the XML output file using Oracle Reports 10g Release 2 10.1.2 patch 2 or later. Or, edit the XML to add type=packageSpec andor type=packageBody in the function element, as follows: programUnits function name=a type=packageSpec textSource [CDATA[PACKAGE a IS function lire return date ; END a;]] textSource function function name=a type=packageBody textSource [CDATA[PACKAGE BODY a IS function lire return date is c2 date; ... END;]] textSource function function name=cf_1formula returnType=date ... function programUnits Note: Although it is possible to create an entire report manually using the Oracle Reports XML tags, only manually created customizations and data models are documented and supported.