Tables in a report
A table in a report is rows of cells. Each cell works like a text control and can hold other controls. It is the usual way to print the lines of a document in neat columns. This page is for the advanced user who adjusts templates.
Creating a table
| Way | How |
|---|---|
| From the toolbox | Add the table control to the band as in Adding a control. |
| From the field list | Drag a set of fields from the Field List to the band to create a table of its fields. |
| From existing text controls | Select the text controls and choose Convert to Table. |
| From a table back to text controls | Select the table and choose Convert To Labels. |
Table commands
The Table Tools tab appears on the ribbon when you select a table or a cell in it. Its commands:
| Command | What it does |
|---|---|
| Row Above | Adds a new row directly above the current row. |
| Row Below | Adds a new row directly below the current row. |
| Column to Left | Adds a new column directly to the left of the current column. |
| Column to Right | Adds a new column directly to the right of the current column. |
| Merge Cells | Merges the selected cells into one cell. |
| Split Cells | Splits the selected cells into the number of rows or columns you specify. |
| Delete the cell, row, column or table | Deletes the current element, or the entire table. |
| Distribute columns or rows evenly | Divides the width of the selected columns, or the height of the selected rows, equally between them. |
| Select the table, row or column | Selects the current element so you can apply one format to it. |
Width and height
- To change the width of a column, drag the border between two cells. To change the height of a row, drag the bottom border of the row.
- To give several columns one width, select them and use the command that distributes columns evenly. Do the same for rows.
- A cell fits its text if you turn on Can Grow and Word Wrap for it. The two properties are explained in Report controls.
Borders and background
Select the cells or the table, then use the border commands on the ribbon: Top Border, Bottom Border, Left Border, Right Border, All Borders and No Border. With them are Border Color, Border Width and Border Dash Style. The color of a cell comes from Background Color. For alternate colors on odd and even rows, see Styles and conditional appearance.
The table of document lines
You build the table of lines from two tables: a table for the titles in the Page Header band, and a table for the lines in the band that prints once for each line. The cells read from the fields of the lines.
An example for a sales invoice:
| Column | Column title text | Expression of the line cell |
|---|---|---|
| 1 | Item | [Material_Name] |
| 2 | Quantity | [Quantity] |
| 3 | Price | ToPrice([Price]) |
| 4 | Total | ToPrice([Total]) |
To get this table:
- Insert a table of one row and four cells in the Page Header band, and type the column titles in its cells.
- Insert a similar table in the band of the line.
- Select the first cell of the line, open the Expressions tab in the Properties panel, and type
[Material_Name]in the Text property. Repeat for the other cells. - Set the widths, add the borders, then open the Preview tab and check the result.
ToPrice and ToQuantity are alameen functions: see The expression editor. The names of the other line fields are in Advanced printing data sources.
Related
This page applies to alameen ERP 10, version 10.1.79.764.