On this page
AX1475
Setting row sizes for Formatted Grids
The way that rows are sized in Formatted Grid components depends on the format type of the grid:
-
Thematic grids: Rows are sized according to the row style applied to each row and the
[RowHeight]
column in the data source. The row height set in the spreadsheet is ignored. - Spreadsheet-formatted grids: Rows are sized based on the row height in the spreadsheet.
In both cases, the overall number of rows that can be displayed in the grid (without scrolling) depends on the height of the Formatted Grid component on the form canvas. The grid will behave as follows depending on whether the rows in the data source can fit into the height of the component:
-
If the overall height of all rows in the data source exceeds the height of the component, then a vertical scroll bar will be present on the grid. The user can use the scroll bar to view all rows.
-
If the overall height of all rows in the data source takes up less space than the height of the component, then the grid behavior depends on the Collapse Height setting in the component properties. If disabled, then the grid remains at its configured height, and there will be blank space between the last row and the bottom edge of the component. If enabled, then the grid auto-shrinks vertically to fit the height of the row contents.
Alternatively, the Extended Height property for the Formatted Grid component can be used to automatically extend the height of the grid downward to accommodate the number of rows in the data source.
Setting row heights for thematic grids
Row heights in thematic grids are set as follows:
-
Each row uses the height set by the row style by default. All base row styles include a specified row height (including the default row style that is used when no base style is specified). Additionally, you can apply add-on styles to set the row height, such as row-height-18. For more information on using row styles, see Using row and column styles in a thematic grid.
-
If a row height is set in the
[RowHeight]
column of the Grid data source, this row height overrides the style. So if the style sets a row height of 12 pixels, but you enter 30 pixels into the[RowHeight]
column, then the row height for that row is 30 pixels.Generally speaking, this column is only intended for cases where you need to override the row style or set the row to a height that is not supported by the available styles. It is not necessary to enter a row height for every row.
NOTE: If the row style includes a minimum row height, this minimum also applies to the height set in the
[RowHeight]
column. For example, styles that impact the font size may include a minimum row height, to ensure that the row is tall enough to show the text.
The following entries are valid in the [RowHeight]
column:
- Value in pixels: For example, you can enter
30
or30px
to set the height to 30 pixels. - Value in percent: Percent values are applied to the height defined by the row style. For example, if the row style is 12 pixels, you can enter 200% to size the row twice the height of the row style (24 pixels).
- Auto: You can enter the keyword
auto
to indicate that the row uses the height defined in the row style. This is for cases where you want to populate all cells of the[RowHeight]
column for clarity, but you want some rows to use the height defined in the style. - Blank: The row uses the height defined in the row style.
Using Extended Height to dynamically expand the grid
If Extended Height is enabled for a grid, then the grid will dynamically extend downward to display all rows in the data source. If the height of the grid exceeds the current window, then the user can scroll the window to view the rest of the grid. This option can be used with thematic grids and spreadsheet-formatted grids.
Use of Extended Height introduces some limitations to the Formatted Grid component. The option is only intended to be used for special situations that require non-scrolling grids with many rows, such as when the form needs to be printed.
-
If Extended Height is enabled, no other components can be placed below the formatted grid on the form canvas. The extended grid will not "push" the other components down; instead the other components will continue to display at their fixed location on the canvas and the formatted grid will extend underneath the other components.
There is one exception to this behavior. If a thematic grid with extended height is placed within a flow panel, the placement of the other components in the flow panel will adjust for the extended height. However, note that the height of the panel itself does not adjust (even if set to dock), so the Overflow property of the panel cannot be set to Hidden.
-
If the grid is a spreadsheet-formatted grid, certain grid features are not compatible with use of the Extended Height option. This includes the following content tags: Checkbox, TextArea, and Sparkline. Also, disabling Auto-Submit will not work as expected if Extended Height is enabled. These limitations do not apply to thematic grids.
-
Fixed rows and columns are not honored when Extended Height is enabled.
-
Depending on the number of rows in the grid and the browser used to view the form, performance may be slow when viewing an extended grid online. If the Extended Height option is being used to facilitate printing, it is recommended to dynamically turn it on and off as needed (as discussed below) to preserve online performance of the grid.
-
The form property Scale to Fit must be disabled in order for the grid to extend when viewing online. If Scale to Fit is enabled, then the Extended Height option is ignored and the grid will scroll as normal. For information on Scale to Fit, see Defining the canvas size of an Axiom form.
Printing considerations
If you intend to allow users to print the form by generating a PDF, then the overall height of all rows should not exceed the component height. In other words, all rows must be visible in order to be printed.
If you know that the rows will never exceed the component height, then no special treatment is necessary for printing. However, if a grid could have many rows, then you may want the grid to scroll online but use Extended Height for printing only. You can dynamically enable or disable Extended Height based on whether the form is currently being converted to a PDF. When a user creates a PDF of an Axiom form, the Is PDF setting on the Control Sheet is changed to On, and then the form is refreshed before the PDF is generated. The Extended Height setting could use a formula such as the following:
=IF(Control_Form!D22="On","On","Off")
In this example, Control_Form!D22 is the location of the Is PDF setting. Extended Height is disabled when users view the form online (Is PDF is Off). But when the form is converted to a PDF (Is PDF is On), then Extended Height is enabled so that all rows display in the PDF document.
NOTES:
- If a grid using extended height is placed within a panel, and the height of the extended grid exceeds the panel height, then the panel Overflow must be set to Visible in order to print the entire grid.
- When generating a PDF of a form for printing, the Scale to Fit setting is automatically disabled.
Get more information and training resources: www.kaufmanhall.com |
Was this topic helpful? formattedgrid_rowheight.htm |
