12
7/23/2019 Oracle 10g Reports 4 of 4 http://slidepdf.com/reader/full/oracle-10g-reports-4-of-4 1/12 Creating Web Layout Templates C

Oracle 10g Reports 4 of 4

Embed Size (px)

Citation preview

Page 1: Oracle 10g Reports 4 of 4

7/23/2019 Oracle 10g Reports 4 of 4

http://slidepdf.com/reader/full/oracle-10g-reports-4-of-4 1/12

Creating Web

Layout Templates

C

Page 2: Oracle 10g Reports 4 of 4

7/23/2019 Oracle 10g Reports 4 of 4

http://slidepdf.com/reader/full/oracle-10g-reports-4-of-4 2/12

Oracle Reports Developer 10g : Build Reports C-2

Creating Web Layout Templates

This appendix explains how to create a Web layout template for Oracle Reports Builder.

You can use templates to define common characteristics and objects that you want to apply to

multiple reports. For example, you can define a template that includes the company logo and

sets fonts and colors for selected areas of a report.

To create an Oracle Reports Web Layout template:

1. Create a template file (.tdf file).

2. Create an HTML file that describes the layout.

3. Update the Web Template description file (rwTemplates.xml).

4. Test the new template.

5. Deploy the template in Oracle Reports and Oracle Application Server.

6. Add the template to the template library.

Page 3: Oracle 10g Reports 4 of 4

7/23/2019 Oracle 10g Reports 4 of 4

http://slidepdf.com/reader/full/oracle-10g-reports-4-of-4 3/12

Oracle Reports Developer 10g : Build Reports C-3

Creating a Web Layout Template

To create a Web layout template in Oracle Reports, you need three files:

1. A paper layout template  (.tdf file) that is used to register the template in reports and

to make the relationship between the HTML and the CSS file in therwTemplates.xml file. It can also be used as a paper template.

2. A Web layout template (.html file) that is used to create the layout of the template

(default header and footer, position of the data area)

3. A Cascading Style Sheet (CSS) file that is used to define the HTML font of the different

 parts of a report.

TDF file HTML CSS

file HTML file

Page 4: Oracle 10g Reports 4 of 4

7/23/2019 Oracle 10g Reports 4 of 4

http://slidepdf.com/reader/full/oracle-10g-reports-4-of-4 4/12

Oracle Reports Developer 10g : Build Reports C-4

Creating a Web Layout Template

Step 1: Create a template file (.tdf)

First, create a Reports template file:

1. In Oracle Reports Builder, choose File > New > Template.

2. In the Object Navigator, under Templates, your new template name is displayed.

3. Specify a name for your template in the Property Inspector, for example MyCompany.

Note: This name is used by Oracle Reports to create the relationship between the HTML

and CSS files.4. Save the file as MYCOMPANY.tdf in the $ORACLE_HOME/reports/templates/

directory.

You have now created a template. You can edit this template for paper reports by using the

Report Wizard.

Page 5: Oracle 10g Reports 4 of 4

7/23/2019 Oracle 10g Reports 4 of 4

http://slidepdf.com/reader/full/oracle-10g-reports-4-of-4 5/12

Oracle Reports Developer 10g : Build Reports C-5

Creating a Web Layout Template

Step 2: Create an HTML file that describes the layout

In an HTML editor, such as Macromedia Dreamweaver, create an HTML page that will define

the areas of your Web layout template.

1. Add the JSP header and taglib, then add the rw:report tag to reference the report

environment:

2. Put all your generic HTML below the following HTML tags:

3. The <rw:style> tag is used to create the link between the template and the CSS that wecreated and references into the rwTemplates.xml file:

4. Put all your generic HTML, such as the company logo in the <BODY> tag:

5. Specify the <rw:dataArea> tag, where the Wizard will insert the report block:

Page 6: Oracle 10g Reports 4 of 4

7/23/2019 Oracle 10g Reports 4 of 4

http://slidepdf.com/reader/full/oracle-10g-reports-4-of-4 6/12

Oracle Reports Developer 10g : Build Reports C-6

Creating a Web Layout Template

Step 2: Create an HTML file that describes the layout (continued)

6. Specify all your generic HTML, such as copyright and contact information before the

</BODY> tag

7. Close the report reference tag

8. Save this document in the $ORACLE_HOME/reports/templates/ directory.

Page 7: Oracle 10g Reports 4 of 4

7/23/2019 Oracle 10g Reports 4 of 4

http://slidepdf.com/reader/full/oracle-10g-reports-4-of-4 7/12

Oracle Reports Developer 10g : Build Reports C-7

Creating a Web Layout Template

Step 3: Update the Web layout template description file

The Web layout template description file rwTemplates.xml is located under

$ORACLE_HOME/reports/templates. This file references Oracle Reports templates with

their associated styles.

Page 8: Oracle 10g Reports 4 of 4

7/23/2019 Oracle 10g Reports 4 of 4

http://slidepdf.com/reader/full/oracle-10g-reports-4-of-4 8/12

Oracle Reports Developer 10g : Build Reports C-8

Creating a Web Layout Template

Step 3: Update the Web layout template description file (continued)

1. In the rwTemplates.xml file, add a new <webTemplate> tag entry file to register your

new template.

You add the <webTemplate> tag between the <webTemplates> </webTemplates> tags.

This tag associates the paper layout template, Web layout template and CSS files. The

code displays a sample <webTemplate> tag for the MyCompany template.

ValueAttribute

references the file name of the HTML template, for examplemyCompany.html.htmlFile

references the name of the CSS file that Report Wizard will place in

the <LINK> tag.

cssFile

references the classSet  id into the current XML file. The classSet

makes the relationship between each field type and the CSS Class.

classSet

references the name of the module in the Reports template file, forexample, mycompany.tdf. This is not the name of the file, but

the name that you see in the Object Navigator.

id

Page 9: Oracle 10g Reports 4 of 4

7/23/2019 Oracle 10g Reports 4 of 4

http://slidepdf.com/reader/full/oracle-10g-reports-4-of-4 9/12

Oracle Reports Developer 10g : Build Reports C-9

Creating a Web Layout Template

Step 3: Update the Web Layout Template Description File (continued)

2. If you have a specific CSS file with new class names, you need to add a new classSetentry in the rwTemplates.xml file. The classSet tag contains all the class name (css)

for each field type. You add the <classSet> tag between the <classSets> </classSets> tags.

3. After adding the <webTemplate> and <classSet> entries, save the rwTemplates.xml

file and restart Reports Builder.

specifies the class name of the <th> and <caption> tags used for the

group above section

GroupAboveHeader 

specifies the class name of the <td> tag used for the summary non

empty cells

TotalNumber 

specifies the class name of the <th> tag used for the summary empty

cells

TotalText

specifies the class name of the <td> tag used for date dataCellDate

specifies the class name of the <td> tag used for numeric data.CellNumber 

ValueName

specifies the class name of the <td> tag used for alphanumeric dataCellText

specifies the class name of the <th> tag used for the column header ColumnHeader 

specifies the class name of the <th> tag used at the row header in

matrix reports

RowHeader 

specifies the class name of the <table> tagTableStyle

Page 10: Oracle 10g Reports 4 of 4

7/23/2019 Oracle 10g Reports 4 of 4

http://slidepdf.com/reader/full/oracle-10g-reports-4-of-4 10/12

Oracle Reports Developer 10g : Build Reports C-10

Creating a Web Layout Template

Step 4: Test the new Web layout template

1. Create a new report using the Report Wizard, and choose the TDF file you created, forexample, MyCompany.tdf template.

2. When you click Finish, you see the new report with your template code. The Report

Wizard replaces the empty <rw:style> and <rw:dataArea > tags with the generated code.

Page 11: Oracle 10g Reports 4 of 4

7/23/2019 Oracle 10g Reports 4 of 4

http://slidepdf.com/reader/full/oracle-10g-reports-4-of-4 11/12

Oracle Reports Developer 10g : Build Reports C-11

Creating a Web Layout Template

Step 5: Deploying the new Web layout template

You should configure Reports Builder to make sure that all associated elements such as images

and CSS files are in the correct place on the file system

While deploying a Web report on the Oracle Application Server, you need to make sure that allthe associated elements such as images and CSS files are in the correct location on the server.

Default CSS directory of Oracle

Reports Builder 

$ORACLE_HOME/reports/docroot/css

Default root directory of Oracle

Reports Builder 

$ORACLE_HOME/reports/docroot/

Default image directory of Oracle

Reports Builder 

$ORACLE_HOME/reports/docroot/images

DescriptionLocation

Page 12: Oracle 10g Reports 4 of 4

7/23/2019 Oracle 10g Reports 4 of 4

http://slidepdf.com/reader/full/oracle-10g-reports-4-of-4 12/12

Oracle Reports Developer 10g : Build Reports C-12

Creating a Web Layout Template

Step 6: Add the Web Layout Template to the Oracle Reports Template Library

If you want your new template to always display in the Predefined Templates list on the

Template page of the Report Wizard, you can add it Oracle Reports Template Library.

You can register your template file as a predefined template by inserting an entry in the

Oracle Reports preferences file and storing the template and (optional) image in the correct

template directory.

Note: This is an optional step.