At times there are requirement for creating BI publishers using Data Template. This type of report use data source as data template rater than rdf.
First we need to define the data Template. The data template is the XML document whose elements communicate the following information to the data engine.
- Data Query : The SQL query with bind parameter specifying the data to be fetched.
- Parameters : Definition of each bind parameter defined in the query.
- Data Structure : Definition of the Output XML Structure.
- Data Triggers : Triggers that should be executed before or after the data query execution. Triggers are used to either do initialization or do some post query operation.
Now if you already have report that is in the rdf format and you would like to convert it to Data Template.
Convert rdf to Data Template
Use DataTemplateGenerator API to migrate the Oracle Reports Data Model to a DataTemplate and associated PL/SQL logic to PL/SQL Package (specification and body).
The API can be called through the command line or through a shell script. This will generate following output files:
- DataTemplate (REPORT.xml)
- Default PL/SQL package specification (REPORTS.pls)
- Default PL/SQL package body (REPORTB.pls)
javaw.exe oracle.apps.xdo.rdfparser.DataTemplateGenerator D:\report\data_temlate.xml
- PL/SQL Package: D:\ report\data_temlateS.pls
- PL/SQL Body: D:\report\data_temlateB.pls
- DataTemplate: D:\report\data_temlate_template.xml
The .pls files generated needs to be compiled into the Database
- If formula column reference the summary column as parameter and the summary column belongs to same Data Source/Data Query, it is not supported in Data Template. This is because of all the formula columns moved to select statement and the summary column value is not available while executing the formula.
- If we use report field properties like page number, sysdate. It will not support in data template.
- Format triggers and Anchor will not support in template we need to include code manually in rtf.
- User Exits will not support in data template,
Convert the Report layout to RTF
XML Publisher 5.6.3 API Package “oracle.apps.xdo.rdfparser” has “RTFTemplateGenerator” class to migrate the Oracle Reports layout to an XML Publisher RTF template. Because there is no support for PL/SQL in an RTF Template, the generator writes all Oracle Report format trigger code to the log file. This must later be implemented as XSL code
javaw.exe oracle.apps.xdo.rdfparser.RTFTemplateGenerator D:\report\data_temlate.xml
RTF Template : D:\report\data_temlate.rtf
Log File : D:\report\data_temlate.log
Create a Concurrent Report Program with Report output as XML and executable as “XDODTEXE”. XDODTEXE is XML Publisher Data Template Executable Engine, which is a Java Concurrent Program.