Oracle XML Publisher Template Builder - Insert Table/Form Dialog

Insert Table/Form Dialog

The Insert Table/Form dialog is the most flexible tool of the template builder. It allows you to perform the following tasks:

·         Create a simple or nested table with a variable number of rows.
·         Associate a group of data elements, such as a complete invoice or a purchase order line,  with a form in the document that will be repeated for each occurrence of the data element
·         Select and define a layout for all the data fields in the template
·         Group or re-group the data


On the Insert menu click Table/Form… to open the Insert Table/Form dialog.

The Insert Table/Form dialog shows you two tree view panes. The left pane shows the data source structure, while the right pane shows the elements that will be copied to the template when you click the Insert button.

Note: This dialog is based on the Drag & Drop paradigm like the Microsoft File Manager.

Selecting Data Fields

First you select the data fields that you want to insert in the template and then you define how to format them. Drag an XML element from the left Data Source pane to the right Template pane to select it. If the XML element has children, you will see a pop-up menu with the following options:

·         Drop Single Node
·         Drop All Nodes
·         Cancel

Select Drop Single Node if you want to move only the selected node or Drop All Nodes if you want to move the node and all its children

If you drag an additional data field from the left Data Source pane to the right Template pane, it is either inserted at the same level (Same Level) or below the node (Child) where you release the node. The Insert Position box defines which way the node is inserted.

Note: If you use the left mouse button for drag and drop, the node and all children are copied. However, if you use the right mouse button for dragging, a dialog pops up when you release the mouse button. The dialog gives you the option to copy either only the selected node or the selected node and all children.

Find

 For an XML document with a large and complicated structure,  use the find functionality to find a specific field. Enter a partial string of the field name you are searching into the Find field and click the Find Next button. The next occurrence of a name that includes your search expression will be selected. Click the Find Next button again to see the next occurrence.

Example

When you select a field name in the data source view, an example value from the sample XML file for this data field is shown below the view behind Example.

Defining the Layout

When you select an element in the right Template pane, you will see its properties as well as a preview of how the node will be rendered. There are two kinds of nodes:

·         Data Fields
·         Data Groups

Data Field nodes (leaf nodes) do not have any child nodes. They represent simple attributes such as the total amount for an invoice or the subtotal for a purchase order line.

Data Group nodes (parent nodes) are nodes that do have child nodes. Typically, they do not represent data attributes, but groups of data – such as an invoice, a purchase order, a purchase order line or a shipment.

Data Field Properties

If a Data Field node is selected, you may define a calculation function for this node. Select the data field in the tree view and then select one of the aggregation functions from the Calculation list box:

·         Average
·         Count
·         Minimum
·         Maximum
·         Sum

Data Group Properties

If a Data Group node is selected, its properties are shown in the Properties pane. You have the following options to describe how the template builder should render the group:

o    Create as Table: if you want a Microsoft Word table to be created around the data fields, select Yes; otherwise select No. If Form is selected for Style, you can only select No.

o    Style: if you want the data to be displayed in a Microsoft Word table use Table. If you want to display the fields below each other, use Form. If Create as Table is set to Yes, you can only select Table.

o    Label: if you want a column header above the table or labels in front of the data fields, select Yes; otherwise select No.

o    Grouping: Grouping is an advanced operation that allows you to group data. You may select a child element of the selected element as a grouping criterion. See below for more information.

o    Show Grouping Value: This property will only be shown if you have selected a node created by the Grouping functionality. You can choose for a group if the Data Field node used as a grouping criterion is shown in the table or form.

The order in which the data elements are shown reflects the order of the columns in the table. If you want to reorder the columns, change the Insert Position box from Child to Same Level. Then drag the elements into the correct order.

Inserting Tables and Forms

Once you have dragged all data fields over and defined the layout, then you must tell the Template Builder to create the tables and forms in your document.

Insert Button

The Insert button creates the tables and forms at the current cursor position of the template.

Close Button

Click the Close button to close the Insert Table/Form dialog. The Close button will not automatically insert any tables or forms into the document.

Grouping

You can group any Data Group node, by any of its child Data Field Nodes. For example if you have sales data for multiple quarters, you may want to show the sales data organized by quarter. In this case you would group the sales data rows by the quarter element.

Assume the following structure:

Sales Transaction
            Quarter
            Customer
            Amount

To group the child nodes of a node (Sales Transaction), you select one of the child nodes (Quarter) as the grouping property of the parent node (Sales Transaction). The Template Builder creates will make this node (e.g. quarter) the parent of the other child nodes (Customer and Amount).

The new structure will look like:

Sales Transaction
            Quarter
            Customer
            Amount

The grouping criterion (Quarter) now behaves like any other Data Group Node with the child node. That means that you can define how the layout of its children is rendered by the Template Builder using the Create As Table, Style, Label, Grouping, and Show Grouping Value properties.

Please refer to the Oracle XML Publisher User’s Guide for additional information on grouping.

Advanced Information

The Insert Table/Form Dialog creates two kinds of form fields:

·         Form fields representing data elements
·         Form fields with processing instructions for repeating table rows or document section