To insert tables into the report use the table wizard. The table wizard helps you to select and organise fields which are part of a collection or class and offers you filtering-, grouping- and sorting-options.

To pop up the table wizard

Click the new table icon in the tool-bar.

The table wizard window also pops up automatically when you drop a collection from the fields list onto the page.

A collection in the field list is indicated by the collection icon: The type in angle brackets indicates the element type.

The table wizard enables you to

1. Choose the data for the table

ReportWeaver offers you a list of collections with elements in it

Table Wizard with open "Data" page

Click one of the collections to select it.
Click the Next- button to pop up the Select-Fields page.
Click the Cancel button to cancel the operation.

2. Select the columns of your table

Table Wizard with open "Select fields-Window"

> Click the > to add the selected fields to your table.
< Click the < to remove the selected fields from your table.
Click the up button to move a selected field up in the list. (this will move the column of the field to the left in the resulting table).
Click the downbutton to move a selected field down in the list. (this will move the column of the field to the right in the resulting table).
formula.. Click to open the oql formula dialog. There you can add a computed field. (E.g. the difference of two fields)
type Sometimes the element type of the collection is not precisely specified. I.e it is only a base class like Object/void. The type button will examine the collection and propose the actual type.
Click the Back button to choose another collection.
Click the Next button to pop up the grouping page.
Click the Finish to add the table to the page template withou further refinements.
Click the Cancel button to cancel the operation.

3. Group elements

Table Wizard with open Grouping page

> Click the >button to turn on grouping by the selected field.
< Click the <button to turn off grouping by the selected field.
Up Click the upbutton to change the order of grouping. Higher fields will be grouped first.
Down Click the downbutton to change the order of grouping.
Ascending Show the groups in ascending order. (Deleselect to sort descending)
Case Select to use the case when sorting. (Deselecting case for a number causes sorting to ignore the sign of the number)

Note:Fields that have been selected for grouping are removed from the list of available fields because each field can only be used once for sorting or grouping.

Note:You can group by more than one field. E.g. You can first group by year, then by moth and finally by day.

3. Sorting

Table Wizard with open sorting page

> Click the >button to turn on sorting by the selected field.
< Click the <button to turn off sorting by the selected field.
Up Click the upbutton to change the order of sorting. Higher fields will be used first for sorting.
Down Click the downbutton to change the order of sorting.
Ascending Show the objects in ascending order. (Deleselect to sort descending)
Case Select to use the case when sorting. (Deselecting case for a number causes sorting to ignore the sign of the number)

Note:Fields that have been selected for sorting are removed from the list of available fields because each field can only be used once for sorting or grouping.

3. Totals

Table Wizard with open totals page

Each field can be totalled with several different functions. And for each function four different totals can be computed:

Functions for numbers:
Sum, Average, Min, Max
Functions for strings:
Min, Max
Group:
The total is calculated for each group. It appears at the bottom of each group.
Grand:
The total is computed for all elements. It appears below the complete table.
Page:
The total is computed for each page. It appears in the page footer.
Running:
The total is computed from the beginning of the table to the end of each page. It appears in the page footer.

Note: In the properties of the table you can select whether running or page totals appear on the last page or not.

Abs:
Select Abs to use absolute values for totals. (lower case for strings)
Up/Down
The order of the totals is the order in which totals are placed on the page. You can change this order here or later on the page template.

Note: The default total is to calculate the grand total with absolute numbers.

4. Filtering

Filtering means the selection of objects (rows) from the collection. ReportWeaver uses OQL query expressions to filter the table. OQL is a superset of SQL (and of EJB-QL) for objects. Please refer to the OQL Reference for details. In the left pane, you can find all the fields, variables, builtins and operators that you can use in your query. Please refer to the OQL Editor reference for details.

Table Wizard with filter page

{short description of image}

Filter Type the Oql expression here.
Check Press Check to compile your OQL expression and to check it for errors. If there are new variables in the query, then the Variable Configurator will pop up.

Hint: Use the $ notation (e.g. $variable) to parameterize your query. (E.g. getPerson.getName=$name) Editing query variables.

5. Interactive Filtering (Pickers)

An interactive filter asks the user which elements from a collection shall appear in the table. To configure an interactive filter, you must specify which field shall appear in the pick-list. You must also specify the prompt string, that indicates what is beeing selected.

picker

  1. The field that will appear in the list.
  2. Press to pop up the field selector.
  3. Enter the prompt string here.

6. Layout

Layout page

{short description of image}

Align with master
This is the default until separate frames are implemented.
Headers
This will automatically create header for the columns. You can change the headers on the page template once the table has been added to the template. If you deselect this check box, then the table will be built without default headers. This is sometimes useful for nested tables. You can add or change the generated headers later in the editor.
Style
Defines the table style to use for this table. Table Styles
Finish
Press finish to create the table in the table template. See below how your table will appear and how you can refine it.

Table editing in the page template

After you have finished the table wizard, the table will appear in your page template as shown below.

{short description of image}
  1. The green rounded rectangle around your table is the table indicator. It is only there as a visual cue, and will not appear in your report output. The top row is for the headers, the bottom row is for the data. The header and data areas are not restricted to one row. You can rearrange your cells by dragging them to different places in their repsepctive areas. However a data cell cannot leave the data area of the table.
  2. Because the table was grouped, an inner table indicator shows where the groups will appear. An inner indicator also shows if tables are nested.
  3. The generated page totals appear in the footer of the page. You can style them like any other cell, but you cannot drag page or running totals out of the footer. Group and grand totals appear after the table in the page body. If the base column for the total is deleted, the totals will be deleted too. To calculate a total indepentently from a table you must create a view.
  4. The selection indicator shows the selected table/cell. Here you can see that the cell for field name is selected in the table of employees, which is nested in the grouped table of jobs.
  5. The fields of the tables collection elements are shown in the fields tab. You can add more columns by dragging a field into the table.
  6. To edit table properties double click a data cell in the and go to the select menu, which allows you to select elements higher in the component hierarchy. Select the table from the menu. When the table is selected from the select menu, then its properties are shown in the properties area. Here you can set all  table properties.
  7. The table menu allows you to change the various settings of a table.

Note: Once the table is generated, you can only edit it through drag and drop and through the functions in the table menu. Here you can do the same things like in the table wizard except changing the grouping structure. Because this completely changes the table, you need to delete the table and create it anew.

For more details see  table editing