ActiveReports 11
Table
ActiveReports 11 > ActiveReports User Guide > Concepts > Page Report/RDL Report Concepts > Toolbox > Table

The Table data region consists of columns and rows that organize data. A Table has three columns and three rows by default, a total of nine cells, each of which is filled with a text box. At design time, you can add or remove columns, rows and groupings to suit your needs. In RDL reports, you can embed other data regions in table cells.

You can also choose to set the height of multiple rows or width of multiple columns using Distribute Rows Evenly and Distribute Columns Evenly options from the context menu of the Table data region. Multiple rows or columns can be selected using Ctrl key and mouse click combination or by simply dragging the mouse over rows and columns.

Adding Data

Once you place the Table data region on a report, you can add data to its cells. As with any data region, you can drag fields from your Fields list onto cells in the table. Although the default report control within each cell of the table is a text box, you can replace it with any other report control, and on RDL reports, you can even add a data region. When you drag a field into a cell in the detail row, ActiveReports automatically provides a label in the table header. As with all report controls, you can use expressions to further manipulate the data within the cells of the table. For more information, see Expressions.

Grouping

One of the types of rows you can add to the table is the group header or group footer. This is useful when you need to create, for example, a report which is grouped by country. You just add a group, and in the Group On expression, choose the Country field from your dataset.

You can also group the data in your detail section, and you can add multiple rows to any group in the table. You can use aggregate functions in group footer rows to provide subtotals. For more information, see Group in a Data Region.

Appearance

There are many ways in which you can control the appearance of the table data region. You can merge cells, control visibility, text color, and background color. You can use graphical elements within the cells and borders on the cells themselves. You can even freeze row and column headers in RDL reports in the HTML5 Viewer. For more information, see Freeze Rows and Columns.

Table Dialog

Properties for the Table are available in the Table dialog. To open it, with the Table data region selected on the report, under the Properties Window, click the Property dialog link.

The Table dialog lets you set properties on the report control with the following pages.

Note: You can select <Expression...> within these properties to create an expression to determine the value.

General

Name: Enter a name for the table that is unique within the report. This name can be called in code. You can only use underscore (_) as a special character in the Name field. Other special characters such as period (.), space ( ), forward slash (/), back slash (\), exclamation (!), and hyphen (-) are not supported.

Tooltip: Enter the value or expression you want to appear when a user hovers the cursor over the table in the viewer at run time.

Dataset name: Select a dataset to associate with the table. The combo box is populated with all of the datasets in the report's dataset collection.

Header and Footer: Select any of the following options.

Visibility

Initial visibility

Visibility can be toggled by another report control: Select this check box to display a toggle image next to another report control. This enables the drop-down box where you can specify the report control which, if clicked, toggles the visibility of the table.

Navigation

Document map label: Enter an expression to use as a label to represent this item in the table of contents (document map).

Bookmark ID: Enter an expression to use as a locator for this table. You will then be able to provide a bookmark link to this item from another report control using a Jump to bookmark action.

Sorting

Click the plus sign button to enter new sort expressions, and remove them using the X button.

In the Expression box, enter an expression by which to sort the data in the group, and under Direction, select Ascending or Descending for the selected sort expression.

Groups

The Groups page of the Table dialog allows you to remove or change the order of items in the Group list using the X and arrow buttons. Click the Add button to add a new group to the table and set up information for each group on the following tabs.

General

Name: Enter a name for the group that is unique within the report. This property cannot be set until after a Group on expression is supplied.

Group on: Enter an expression to use for grouping the data.

Document map label: Enter an expression to use as a label to represent this item in the table of contents (document map).

Parent group: For use in recursive hierarchies. Enter an expression to use as the parent group.

Filters

You need to provide three values to add a new filter to the collection: Expression, Operator, and Value.

Expression: Enter the expression to use for evaluating whether data should be included in the group.

Operator: Select from the following operators to decide how to compare the expression to the left with the value to the right.

  • Equal Only choose data for which the value on the left is equal to the value on the right.
  • Like Only choose data for which the value on the left is similar to the value on the right.
    For more information on using the Like operator, see the MSDN Web site.
  • NotEqual Only choose data for which the value on the left is not equal to the value on the right.
  • GreaterThan Only choose data for which the value on the left is greater than the value on the right.
  • GreaterThanOrEqual Only choose data for which the value on the left is greater than or equal to the value on the right.
  • LessThan Only choose data for which the value on the left is less than the value on the right.
  • LessThanOrEqual Only choose data for which the value on the left is less than or equal to the value on the right.
  • TopN Only choose items from the value on the left which are the top number specified in the value on the right.
  • BottomN Only choose items from the value on the left which are the bottom number specified in the value on the right.
  • TopPercent Only choose items from the value on the left which are the top percent specified in the value on the right.
  • BottomPercent Only choose items from the value on the left which are the bottom percent specified in the value on the right.
  • In Only choose items from the value on the left which are in the array of values specified on the right.
    Selecting this operator enables the Values list at the bottom.
  • Between Only choose items from the value on the left which fall between the pair of values you specify on the right. Selecting this operator enables two Value boxes instead of one.

Value: Enter a value to compare with the expression on the left based on the selected operator. For multiple values used with the Between operator, the lower two value boxes are enabled.

Values: When you choose the In operator, you can enter as many values as you need in this list.

Sorting

Click the plus sign button to enter new sort expressions, and remove them using the X button.

In the Expression box, enter an expression by which to sort the data in the group, and under Direction, select Ascending or Descending for the selected sort expression.

Visibility

Initial visibility

  • Visible: The group is visible when the report runs.
  • Hidden: The group is hidden when the report runs.
  • Expression: Use an expression with a Boolean result to decide whether the group is visible. True for hidden, False for visible.

Visibility can be toggled by another report control: Select this check box to display a toggle image next to another report control. The user can click the toggle item to show or hide this band group. This enables the drop-down list where you can select the TextBox control that users can click to show or hide this group.

Data Output

Element name: Enter a name to be used in the XML output for this group.

Collection: Enter a name to be used in the XML output for the collection of all instances of this group.

Output: Choose Yes or No to decide whether to include this group in the XML output.

Layout

Page break at start: Inserts a page break before the group.

Page break at end: Inserts a page break after the group.

Include group header: Adds a group header band (selected by default).

Include group footer: Adds a group footer band (selected by default).

Repeat group header: Repeats the group header band on each page.

Repeat group footer: Repeats the group footer band on each page.

Prevent orphaned footer: Prints the last detailed row with the footer in order to prevent orphaned footer on the next page.

Detail Grouping

Detail grouping is useful when you do not want to repeat values within the details. When a detail grouping is set, the value repeats for each distinct result of the grouping expression instead of for each row of data. For example, if you use the Customers table of the NorthWind database to create a list of countries without setting the details grouping, each country is listed as many times as there are customers in that country. If you set the details grouping to =Fields!Country.Value each country is listed only once.

Note: If the detail grouping expression you use results in a value that is distinct for every row of data, a customer number for example, you will see no difference in the results.

Go to the Detail Grouping page has the following tabs.

General

Name: Enter a name for the group that is unique within the report. This property cannot be set until after a Group on expression is supplied.

Group on: Enter an expression to use for grouping the data.

Document map label: Enter an expression to use as a label to represent this item in the table of contents (document map).

Parent group: For use in recursive hierarchies. Enter an expression to use as the parent group.

Filters

You need to provide three values to add a new filter to the collection: Expression, Operator, and Value.

Expression: Enter the expression to use for evaluating whether data should be included in the group.

Operator: Select from the following operators to decide how to compare the expression to the left with the value to the right.

  • Equal Only choose data for which the value on the left is equal to the value on the right.
  • Like Only choose data for which the value on the left is similar to the value on the right.
    For more information on using the Like operator, see the MSDN Web site.
  • NotEqual Only choose data for which the value on the left is not equal to the value on the right.
  • GreaterThan Only choose data for which the value on the left is greater than the value on the right.
  • GreaterThanOrEqual Only choose data for which the value on the left is greater than or equal to the value on the right.
  • LessThan Only choose data for which the value on the left is less than the value on the right.
  • LessThanOrEqual Only choose data for which the value on the left is less than or equal to the value on the right.
  • TopN Only choose items from the value on the left which are the top number specified in the value on the right.
  • BottomN Only choose items from the value on the left which are the bottom number specified in the value on the right.
  • TopPercent Only choose items from the value on the left which are the top percent specified in the value on the right.
  • BottomPercent Only choose items from the value on the left which are the bottom percent specified in the value on the right.
  • In Only choose items from the value on the left which are in the array of values specified on the right.
    Selecting this operator enables the Values list at the bottom.
  • Between Only choose items from the value on the left which fall between the pair of values you specify on the right. Selecting this operator enables two Value boxes instead of one.

Value: Enter a value to compare with the expression on the left based on the selected operator. For multiple values used with the Between operator, the lower two value boxes are enabled.

Values: When you choose the In operator, you can enter as many values as you need in this list.

Visibility

Initial visibility

  • Visible: The group is visible when the report runs.
  • Hidden: The group is hidden when the report runs.
  • Expression: Use an expression with a Boolean result to decide whether the group is visible. True for hidden, False for visible.

Visibility can be toggled by another report control: Select this check box to display a toggle image next to another report control. The user can click the toggle item to show or hide this band group. This enables the drop-down list where you can select the report control that users can click to show or hide this group.

Data Output

Element name: Enter a name to be used in the XML output for this group.

Collection: Enter a name to be used in the XML output for the collection of all instances of this group.

Output: Choose Yes or No to decide whether to include this group in the XML output.

Layout

Page break at start: Inserts a page break before the group.

Page break at end: Inserts a page break after the group.

Has own page numbering: Used in conjunction with the "Page Number in Section" and "Total Pages in Section" properties, tells the report that the group constitutes a new page numbering section.

Filters

The Filters page of the Table dialog allows you to control the Filter grid collection for the table. Use the arrow and X buttons to move or delete filters. You need to provide three values to add a new filter to the collection: Expression, Operator, and Value.

Expression: Enter the expression to use for evaluating whether data should be included in the table.

Operator: Select from the following operators to decide how to compare the expression to the left with the value to the right:

Value: Enter a value to compare with the expression on the left based on the selected operator. For multiple values used with the Between operator, the lower two value boxes are enabled.

Values: When you choose the In operator, you can enter as many values as you need in this list.

Data Output

Element name: Enter a name to be used in the XML output for this table.

Output: Choose Auto, Yes, or No to decide whether to include this table in the XML output. Choosing Auto exports the contents of the table.

Detail element name: Enter a name to be used in the XML output for the data element for instances of the table. This name is ignored if you have specified a details grouping.

Detail collection name: Enter a name to be used in the XML output for the data element for the collection of all instances of the detail grouping.

Data element output: Choose Yes or No to decide whether to include the details in the XML output.

Table Layout Actions

The Table data region provides context menu options to perform basic layout actions. You can access layout options for Table rows from the context menu by right-clicking on a selected row.

You can access layout options for Table columns from the context menu by right-clicking on a selected column.

See Also

How To