Pivot Table Elements and Terminology

26-6 Web User Interface Developers Guide for Oracle Application Development Framework

26.5 Sorting in a Pivot Table

Pivot tables support sorting of data within the pivot table. When sorting is enabled, ascending and descending sort icons are displayed as the user hovers the cursor over the innermost layer of the column header. By default, the sortMode attribute of the dvt:pivotTable component is set to grouped, effectively sorting the data grouped by the row edge outermost layer. Figure 26–10 shows the sort icons in the World Sales column of the pivot table, where the data is grouped by the Year row edge outermost layers. Figure 26–10 Ascending and Descending Sorting Icons in a Pivot Table

26.6 Sizing in a Pivot Table

When you create a pivot table, default settings determine the overall size of that pivot table. The pivot table also automatically sizes rows, columns, and layers within the space allowed for the overall size. You have the option of changing the overall size of the pivot table, resizing rows and columns, and resizing layers.

26.6.1 How to Set the Overall Size of a Pivot Table

The default size of a pivot table is a width of 300 pixels and a height of 300 pixels. Instead of entering pixels for width and height, you have the option of specifying a percentage value for width, height, or both. This percentage value refers to the portion of the page that you want the pivot table to use. To customize the default settings of a pivot table: 1. In the visual editor, display the page that contains the pivot table.

2. Click Source to display the XML code on the JSPX page.

3. Enter the following code for the inlineStyle attribute of the pivotTable tag,

where value1 is an integer with the unit type for the width of the pivot table and value2 is an integer with the unit type for the height of the pivot table: inlineStyle=width:value1;height:value2. Example 26–2 shows the setting of the inlineStyle attribute that specifies the width of the table as 50 percent of the page size and the height of the table as 400 pixels. Example 26–2 XML Code for Customizing Pivot Table Size dvt:pivotTable . . . inlineStyle=width:50;height:400px dvt:pivotTable Using ADF Pivot Table Components 26-7

26.6.2 How to Resize Rows, Columns, and Layers

The pivot table autosizes rows, columns, and layers when the pivot table is initially displayed. At runtime, you can change the size of rows, columns, or layers by dragging the row, column, or layer separator to a new location. To resize rows, columns, and layers at runtime: 1. If you want to resize a row, do the following: a. Position the cursor in the row header on the separator between the row you want to resize and the next row. b. When the cursor changes to a double-sided arrow, click and drag the row separator to the desired location. 2. If you want to resize a column, do the following: a. Position the cursor in the column header on the separator between the column you want to resize and the next column. b. When the cursor changes to a double-sided arrow, click and drag the column separator to the desired location. 3. If you want to resize a layer, do the following: a. Position the cursor in the row or column header on the separator between the layer you want to resize and the next layer. b. When the cursor changes to a double-sided arrow, click and drag the layer separator to the desired location.

26.6.3 What You May Need to Know About Resizing Rows, Columns, and Layers

When you resize rows, columns, or layers, the new sizes remain until you perform a pivot operation. After a pivot operation, the new sizes are cleared and the pivot table rows, columns, and layers return to their original sizes. If you do not perform a pivot operation, then the new sizes remain for the life of the session. However, you cannot save these sizes through MDS Metadata Services customization.

26.7 Updating Pivot Tables with Partial Page Rendering

You can update pivot tables, for example, to display the totals in a pivot table when triggered by a checkbox, by using partial page rendering PPR. PPR allows only certain components on a page to be rerendered without the need to refresh the entire page. For more information about PPR, see Chapter 7.1, Introduction to Partial Page Rendering. For a component to be rerendered based on an event caused by another component, it must declare which other components are the triggers. Use the partialTriggers attribute to provide a list of IDs of the components that should trigger a partial update of the pivot table. The pivot table listens on the trigger components and if one of the trigger components receives an event that will cause it to update in some way, the pivot table is also updated. Example 26–3 shows sample code for updating a pivot table by displaying the totals when a checkbox is triggered. The triggering component uses the ID as the partialTriggers value.