Inserting a Table
With the table wizard, it is easy to create tables in a report, however, the wizard varies slightly with different report types: web report/library component, and page report.
A table can be inserted in the report areas listed in Component placement.
Below is a list of the sections covered in this topic:
Inserting a Table into a Web Report or Library Component
- Position the mouse pointer at the destination where you want to insert the table.
- Do either of the following:
- Drag the required table type button from the Grid category of the Components panel to the destination.
- Select Insert > Table or Home > Insert > Table, then in the Table Type dialog choose a type for the table.
- In the Data screen, select a business view in the current catalog on which to create the table.
- Specify the data displayed in the table. Depending on the table type selected in step 2, the screens for defining the data vary:
To define the data for a group left, group above, or group left above table:
- In the Display screen, specify a title for the table in the Title text field, then add the business view elements or dynamic formulas to be displayed in the table. To add a field, select it in the Resources box, then select or drag and drop it to the display field box on the right. You can add only one field at a time. If a field is not required, select it and select or drag and drop it to the Resources box. You can add or remove only one field at a time. Select or to adjust the order of the fields. If required, modify the display name of any added field by selecting its Display Name text box. You can also select the Sort Fields By button to specify how to sort data in the table.
- In the Group screen, add the group objects or dynamic formulas as the grouping criteria.
- To add summaries, go to the Summary screen. In the sum on box on the right, specify the group to which the summary will be applied (if you select Table, it will be based on the whole dataset), select an aggregation object or dynamic resource in the Resources box as the summary field and select or drag and drop it to the right box, then specify where to place the summary in the table from the Position and Column columns. You can add several summaries for any group level. If a summary is not required, select it and select or drag and drop it to the Resources box. Select or to adjust the order of the summaries in the current group or move a summary to another group if needed.
To define the data for a summary table:
- In the Columns screen, specify the columns you want to display in the table. Only aggregation and group objects in the specified business view and dynamic resources can be added to the table. To add a column, select a field in the Resources box and select or drag and drop it to the column box on the right. You can add only one field at a time. If a field is not required, select it and select or drag and drop it to the Resources box. Select or to adjust the order of the fields. The table will then be automatically grouped by the added group objects and the position of the group objects in the right box determines the group level: the topmost group object the highest group level and the lowest group object the innermost group level. All the aggregation objects are parallel and calculate based on the lowest group. For a group, you can specify the sorting manner of the group and define the Select N condition to show data of certain range in the group.
- In the Summary screen, you can insert the aggregation objects selected in the Columns screen to the table header/footer and to the group headers/footers of existing groups as summaries. First select an aggregation object in the Resources box, then select the checkboxes representing the required locations. The summary will be placed in the intersection of its summary column and the table/group header/footer row.
- In the Filter screen, define filter conditions to filter the data displayed in the table.
- In the Style screen, specify the style of the table.
- Select Finish to insert the table.
If you have used the menu tab command to insert the table and specified to insert it to position other than the report body or tabular cell, after selecting Finish in the wizard, you need to select the mouse button in the destination once again in order to insert the table there.
Inserting a Table into a Page Report
A page report can be created either based on query resources or business views, which is determined at the time when the page report is created by the Create Using Business View option. Once defined, all the data components in the page report can only be created on the specified data resource type. The procedure for creating a table in a page report varies with the data resource type specified for the page report: query resource or business view.
To insert a table in a page report that is based on query resources:
- Position the mouse pointer at the destination where you want to insert the table. It can be in an empty area of the page report or inside a banded object.
- Do either of the following:
- Drag the required table type button from the Grid category of the Components panel to the destination.
- Select Insert > Table or Home > Insert > Table, then in the Table Type dialog choose a type for the table.
- Table (Group Above)
Creates a table with group information above the detail row. - Table (Group Left)
Creates a table with group information left to the detail row. - Table (Group Left Above)
Creates a table with group information left and above the detail row. - Summary Table
Creates a table with only group and summary information.
- Table (Group Above)
The Create Table wizard appears.
- In the Data screen, select the data resource on which to create the table. If the given data resources are not what you want, select the first item in the corresponding resource node to create one. When a query is selected, select the Edit button to modify the query if required. Then a new dataset based on the selected data resource is created in the page report.
If you want to use an existing dataset in the current page report to create the table, select the More Options button and then:
- Check the Existing Dataset radio button and select a dataset. You can select the Edit button to modify the selected dataset in the Dataset Editor if necessary, or select the <New Dataset...> item to create a new dataset in the page report to use. It is always better to use an existing dataset rather than create a new one. Even when the two datasets are based on the same query, Logi JReport will still run the query separately for each dataset.
- Check the Current Dataset radio button to make the table inherit the dataset from its parent.
- In the Display screen, add the fields to be displayed in the table. To add a field, select it in the Resources box and select or drag and drop it from the Resources box to the display field box on the right. You can add only one field at a time. If a field is not required, select it and select or drag and drop it to the Resources box. Select or to adjust the order of the fields. If required, modify the display name of any added field by selecting its Display Name text box. You can also select the Sort Fields By button to specify how to sort data in the table.
- In the Group screen, add the fields as the grouping criteria.
- To add summaries, go to the Summary screen. In the sum on box on the right, specify the group to which the summary will be applied (if you select Table, it will be based on the whole dataset), select a field in the Resources box as the summary field and select or drag and drop it to the right box, then select the function for the summary from the Aggregate Function column. You can add several summaries for any group level. Logi JReport will automatically give the summaries proper name labels to help you clarify the meaning of the numbers. If a summary is not required, select it and select or drag and drop it to the Resources box. Select or to adjust the order of the summary fields in the current group or move a summary field to another group if needed.
The summaries created from the Summary screen will be added to the current catalog data source as static summaries even when identical summaries already exist. Therefore, it is better not to create summaries here, instead you can add dynamic summaries to the catalog and drag and drop the dynamic summaries into the table after it is created.
- To apply filters to the table so as to reduce the data displayed in the table, go to the Filter screen and define the filter conditions.
- In the Style screen, specify the layout and style of the table.
When you have specified to insert the table into a banded object, by default the table will inherit its parent's style. If you want to apply another style to the table, uncheck the Inherit Style option and then select the required style from the Style box. For more information, see Inheriting Styles.
- Select Finish to insert the table.
If you have used the menu tab command to insert the table and specified to insert it to position other than the report body or tabular cell, after selecting Finish in the wizard, you need to select the mouse button in the destination once again in order to insert the table there.
When the table is inserted into a banded object, you can set up data container link between the table and its parent.
To insert a table in a page report that is based on business views:
- Position the mouse pointer at the destination where you want to insert the table. It can be in an empty area of the page report or inside a banded object.
- Do either of the following:
- Drag the required table type button from the Grid category of the Components panel to the destination.
- Select Insert > Table or Home > Insert > Table, then in the Table Type dialog choose a type for the table.
The Create Table wizard appears.
- In the Data screen, select a business view on which to create the table.
- In the Display screen, provide the title of the table if needed and add the fields to be displayed in the table. To add a field, select it in the Resources box and select or drag and drop it from the Resources box to the display field box on the right. You can add only one field at a time. If a field is not required, select it and select or drag and drop it to the Resources box. Select or to adjust the order of the fields. If required, modify the display name of any added field by selecting its Display Name text box. You can also select the Sort Fields By button to specify how to sort data in the table.
- In the Group screen, add the fields as the grouping criteria.
- In the Summary screen, add aggregations to summarize data in the table. In the right box, specify the group to which the aggregation will be applied (if you select Table, the aggregation will be based on the whole dataset), select an aggregation in the Resources box and select or drag and drop it to the right box. You can add several aggregations for any level. Logi JReport will automatically give the aggregations proper name labels to help you clarify the meaning of the numbers. If an aggregation is not required, select it and select or drag and drop it to the Resources box. Select or to adjust the order of the aggregations in the current group or move an aggregation to another level if needed.
- To apply filters to the table so as to reduce the data displayed in the table, go to the Filter screen and define the filter conditions.
- In the Style screen, specify the layout and style of the table.
When you have specified to insert the table into a banded object, by default the table will inherit its parent's style. If you want to apply another style to the table, uncheck the Inherit Style option and then select the required style from the Style box. For more information, see Inheriting Styles.
- Select Finish to insert the table.
If you have used the menu tab command to insert the table and specified to insert it to position other than the report body or tabular cell, after selecting Finish in the wizard, you need to select the mouse button in the destination once again in order to insert the table there.
Notes:
- The content of the table in some pages that cannot be displayed will be cut off if the height of the table is higher than that of the page, however, when exporting the table to an Excel file with column format or data format, or to text with delimited format, or to XML, no content will be cut off.
- When creating a table of the Group Above or Group Left type, by default all the summaries of the same functions will be aligned horizontally in the table. If you want to align them vertically, check the option Align summaries vertically in the Options dialog in advance.
See also:
- An example: The SampleComponents catalog, included with Logi JReport Designer, contains reports that have examples of report component types. For the table component example, open
<install_root>\Demo\Reports\SampleComponents\TableReport.cls
.