Skip to main content

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​

WayHow
From the toolboxAdd the table control to the band as in Adding a control.
From the field listDrag a set of fields from the Field List to the band to create a table of its fields.
From existing text controlsSelect the text controls and choose Convert to Table.
From a table back to text controlsSelect 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:

CommandWhat it does
Row AboveAdds a new row directly above the current row.
Row BelowAdds a new row directly below the current row.
Column to LeftAdds a new column directly to the left of the current column.
Column to RightAdds a new column directly to the right of the current column.
Merge CellsMerges the selected cells into one cell.
Split CellsSplits the selected cells into the number of rows or columns you specify.
Delete the cell, row, column or tableDeletes the current element, or the entire table.
Distribute columns or rows evenlyDivides the width of the selected columns, or the height of the selected rows, equally between them.
Select the table, row or columnSelects 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:

ColumnColumn title textExpression of the line cell
1Item[Material_Name]
2Quantity[Quantity]
3PriceToPrice([Price])
4TotalToPrice([Total])

To get this table:

  1. Insert a table of one row and four cells in the Page Header band, and type the column titles in its cells.
  2. Insert a similar table in the band of the line.
  3. 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.
  4. 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.

This page applies to alameen ERP 10, version 10.1.79.764.