Resizing Rows and Columns in Java-Client Crosstabs

In a Java-client crosstab, there are two main mechanisms for sizing rows and columns. The crosstab can automatically determine an appropriate size for a cell, or you can set sizes explicitly. End-users can drag the boundaries of cells to resize rows and columns as well, to set the sizes explicitly.

The crosstab uses default sizes for columns and rows, and it also automatically sizes columns and rows for you. It bases automatic sizes on the data in the cell, the size of the font in which the data is displayed, whether word-wrapping is enabled for the cell, and so on. Each time new data is displayed in the crosstab, cells are automatically resized, for better readability. As the sizes of columns and rows change, the crosstab changes the default sizes as necessary.

Controlling automatic resizing

You can set properties of the crosstab to specify what the crosstab should automatically resize and how it should determine sizes. The following table lists properties that affect automatic sizing in a crosstab. These properties are defined in the oracle.dss.gridView.GridView class.

Property

Description

AutoFitScope

Tells the crosstab what to autofit, such as row heights, column widths, column widths in the row headers, row heights in the column headers, and so on.

AutoFitRowCount

Tells the crosstab how many rows to consider when it calculates an autofit size; the default value is 20

AutoFitColumnCount Tells the crosstab how many columns to consider when it calculates an autofit size; the default value is 20

For finer control over autofitting, you can implement callbacks and register them with the crosstab. To have the crosstab consider a particular set of rows, create and register an AutoFitRowRangeCallback. To have the crosstab consider a particular set of columns, create and register an AutoFitColumnRangeCallback.

Measures and column sizes

In a crosstab, column sizes are dependent upon the location of the measures in the data layout. When measures are on the column edge, and you resize a column that has a measure label, all columns associated with that same measure will also be resized.

For example, suppose you had a crosstab that displayed Sales and Cost data, and you had the measures on the column edge, under different time periods. If you manually change the size of the Sales column under March, then the Sales columns under April and May and any other time periods in the crosstab will also change size, to match the Sales column under March.

When measures are on the page edge or on the row edge, and you resize one column, all columns will also be resized.

When manual row sizing is enabled, you can resize each row independently.

Controlling manual sizing

By default, users can change the size of columns in the databody and in the row header. They cannot change row height in the crosstab. The following properties allow you to control what users can resize by dragging borders with the mouse.

Property

Description

ManualRowSizingEnabled Specifies whether users can manually change the height of the rows in the databody
ManualColumnSizingEnabled Specifies whether users can manually change the width of the rows in the databody
ManualColumnHeaderRowSizingEnabled Specifies whether users can manually change the row height in the column header
ManualRowHeaderColumnSizingEnabled Specifies whether users can manually change the column width in the row header

Properties that manual resizing sets

The following table describes crosstab properties that specify manually set sizes for cells. When users drag cell boundaries to resize parts of a crosstab, these properties are automatically set.

Sizing property

Description

ColumnWidth

The width of a column in the databody

RowHeight

The height of a row in the databody

ColumnHeaderRowHeight

The height of a row in the column header

RowHeaderColumnWidth

The width of a column in the row header