Inserting Tables in a Report
You can create tables in a report easily using the table wizard, however, the wizard varies with the data resource type used for the table: business view or query resource. This topic introduces how you can create a table with the table wizard using different data resource.
You can insert tables in the report areas listed in Component Placement. When you insert a table into a banded object in a page report, you can use a data container link to define the relationship between the table and its parent.
A page report can use either query resources or business views, which is determined by the Create Using Business View option at the time when you create the page report. Once defined, all the data components in the page report can only use the specified data resource type.
This topic contains the following sections:
Creating a Table Based on a Business View
- Position the mouse pointer at the destination where you want to insert the table.
- Do either of the following:
- From the Components panel, drag the required table type icon in the Grid category to the destination.
- Navigate to Insert > Table or Home > Insert > Table, then in the Table Type dialog box choose a type for the table.
- Table (Group Above)
Select to create a table which displays the group information above the detail row. - Table (Group Left)
Select to create a table which displays the group information left to the detail row. - Table (Group Left Above)
Select to create a table which displays the group information left and above the detail row. - Summary Table
Select to create a table which displays only the group and summary information.
- Table (Group Above)
Designer displays the Create Table dialog box, which contains a set of screens for helping you define a table easily. You can use the Back and Next buttons or select the screen name on the screen navigation bar to switch between the screens. When creating a table in a web report or library component, you get different screens according to the selected table type: group table or summary table.
- In the Data screen, select the business view in the current catalog that you want to use to create the table.
If you have specified to insert the table into any of the following panels in a banded object: banded header panel, banded footer panel, group header panel, or group footer panel, Designer displays the Inherit from the Parent option. Select it if you want the table to inherit the business view that its parent banded object uses.
- Specify the data to display in the table.
To define the data for a group table in a web report/library component, or for a table in a page report
- In the Display screen, add the detail fields you want to display in the table. You can specify a title for the table in the Title text box.
The Resources box lists the data objects that you can use as detail fields in the table. These objects include: group objects and detail objects in the specified business view, and dynamic formulas used as Group and dynamic formulas used as Detail that you have created for the business view in the current report.
To add a detail field, select an object in the Resources box and select Add or drag the object from the Resources box to the right box. If you want to adjust the display order of the detail fields in the table, select a field in the right box and select Move Up or Move Down. In the Display Name column, you can select in the text box to edit the label for each detail column in the table; when you select the Auto Map Field Name checkbox in the text box, Designer applies the field's display name to label the detail column, and at runtime, Server maps the label to the dynamic display name of the field if the administrator defines it. You can also select Sort Fields By to specify how to sort the detail values.
- In the Group screen, specify the criteria for grouping data in the table.
- In the Summary screen, add summaries to calculate data in the table.
The Resources box lists the aggregation objects in the specified business view, and the dynamic formulas used as Aggregation and dynamic aggregations that you have created for the business view in the current report. You can add them as summaries to calculate data in the table.
To add a summary in the table, in the right box, select the group to which to apply the summary (if you select Table, it is based on the whole business view), select an object in the Resources box and select Add or drag the object from the Resources box to the right box. You can add several summaries for any group level, and use Move Up and Move Down to adjust the display order of the summaries in a group or move a summary to another group. The Position and Column options work together to determine the positions of the summaries in the table.
- If the table is of the Group Above type, Designer places a summary added for the Table level in the intersection of the table footer panel and the first two detail columns with its name label which is the display name of the field used for the summary by default; Designer places a summary added for a specific group in the intersection of the group's footer panel and the first two detail columns with its name label.
- If the table is of the other types, you can customize the position of the summaries. When a summary is added for the Table level, you can place it and its name label in the intersection of the table footer panel (Footer)/table header panel (Header) and the first two detail columns (Detail)/a new summary column (Summary); for a summary added to a specific group, you can place it and its name label in the intersection of the group footer panel/group header panel and the first two detail columns/a new summary column.
To define the data for a summary table in a web report/library component
- In the Columns screen, specify the columns you want to display in the table.
The Resources box lists the group objects and aggregation objects in the specified business view, and the dynamic formulas used as Group , dynamic formulas used as Aggregation , and dynamic aggregations that you have created for the business view in the current report. You can create columns in the table from these objects.
To add a column, select an object in the Resources box and select Add or drag the object from the Resources box to the right box. If you want to adjust the display order of the columns in the table, select an object in the right box and select Move Up or Move Down. Designer automatically groups the table 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 innermost group. For any group level, you can customize its sort manner and define Select N condition to show data of certain range in its groups.
- In the Summary screen, 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. Designer places the summary in the intersection of the corresponding summary column and the table/group header/footer panel.
- In the Display screen, add the detail fields you want to display in the table. You can specify a title for the table in the Title text box.
- In the Filter screen, apply a filter to reduce the data to display in the table. You can select a predefined filter of the specified business view from the Filter drop-down list to apply, or select User Defined in the list to define a new filter as required.
- In the Style screen, specify the layout and style of the table.
By default, Designer places the table vertically. If you are creating the table in a page report, you can select Horizontally in the Grow Report box to create a horizontal table.
In the Style box, select the style of the table. If you have specified to insert the table into a banded object, the table inherits its parent's style by default; to apply another style to the table, clear Inherit Style and select the required style from the Style box.
- Select Finish to insert the table.
If you have used the menu tab command to insert the table and selected a panel in a banded object as the table destination, after finishing in the dialog box, you need to select in the destination once again in order to insert the table there.
Creating a Table Based on a Query Resource
- Position the mouse pointer at the destination where you want to insert the table.
- Do either of the following:
- From the Components panel, drag the icon representing the required table type in the Grid category to the destination.
- Navigate to Insert > Table or Home > Insert > Table, then in the Table Type dialog box choose a type for the table.
Designer displays the Create Table dialog box, which contains a set of screens for helping you define a table easily. You can use the Back and Next buttons or select the screen name on the screen navigation bar to switch between the screens.
- In the Data screen, select the data resource in the current catalog that you want to use to create the table.
If the predefined data resources are not what you want, you can select the first item under a resource node to create a data resource of the type in the current catalog to use. When you select a query, you can select Edit to modify the query. Designer then automatically creates a dataset based on the selected data resource in the page report.
If you want to use an existing dataset in the current page report to create the table, select More Options and then:
- Select Existing Dataset and select a dataset. You can select Edit to modify the specified dataset in the Dataset Editor dialog box, or select <New Dataset...> to create a 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 Report Engine still runs the query separately for each dataset.
- If you have specified to insert the table into an object that already applies a dataset, such as a banded panel, Designer enables the Current Dataset radio button. Select it if you want the table to inherit the dataset from the parent object.
- In the Display screen, add data fields to display as detail fields in the table.
The Resources box lists all the DBFields in the specified data resource, and the formulas and parameters that are valid to these DBFields in the current catalog. You can use them as detail fields in the table.
To add a detail field, select a field in the Resources box and select Add or drag the field from the Resources box to the right box. If you want to adjust the display order of the detail fields in the table, select a detail field in the right box and select Move Up or Move Down. By default, Designer applies the display names of the added fields to label the corresponding detail columns; to edit the label for a detail column, select in the Display Name text box and type a new name. You can select Sort Fields By to specify how to sort the detail values.
When you are creating a summary table, by default, Designer does not show the detail columns for the added detail fields after the table is generated. If you want to show the detail columns in a summary table, take the following steps after the table is created:
- Select the table, right-click it and select Show Column on the shortcut menu.
- In the Show Column dialog box, select the column names for the detail columns you want to show and select OK.
- In the Report Inspector, select the Table Detail node of the table, set the Invisible property to false.
- In the Group screen, specify the criteria for grouping data in the table.
- In the Summary screen, add summaries to calculate data in the table.
The Resources box lists all the DBFields in the specified data resource, and the formulas that are valid to these DBFields in the current catalog. You can create summaries based on these fields in the table.
To add a summary, select the group in the right box to which to apply the summary (if you select Table, it is based on the whole dataset), select a field in the Resources box and select Add or drag the field from the Resources box to the right box, then specify the aggregate function of the summary. If you select DistinctSum, you should select the ellipsis in the Distinct On text box to specify one or more fields according to whose unique values to calculate DistinctSum using the Select Fields dialog box. You can add several summaries for any group level. After the table is created, Designer automatically gives the summaries proper name labels to help you clarify the meaning of the numbers. You can use Move Up and Move Down to adjust the display order of the summaries in the current group or move a summary to another group. The Position and Column options work together to determine the positions of the summaries in the table.
- If the table is of the Group Above type, Designer places a summary added for the Table level in the intersection of the table footer panel and the first two detail columns with its name label which is the display name of the field used for the summary; Designer places a summary added for a specific group in the intersection of the group's footer panel and the first two detail columns with its name label.
- If the table is of the other types, you can customize the position of the summaries. For a summary added for the Table level, you can place it and its name label in the intersection of the table footer panel (Footer)/table header panel (Header) and the first two detail columns (Detail)/a new summary column (Summary); for a summary added to a specific group, you can place it and its name label in the intersection of the group footer panel/group header panel and the first two detail columns/a new summary column.
Designer automatically adds the summaries created from the Summary screen to the current catalog 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 you finish creating it.
- In the Filter screen, add filter conditions based on the fields you have added to the table to reduce the data. Select here for how to define a filter.
- In the Style screen, specify the layout and style of the table.
In the Grow Report box, select whether to place the table vertically or horizontally. In the Style box, select the style of the table. If you have specified to insert the table into a banded object, the table inherits its parent's style by default; to apply another style to the table, clear Inherit Style and select the required style from the Style box.
- Select Finish to insert the table.
If you have used the menu tab command to insert the table and selected a panel in a banded object as the table destination, after finishing the dialog box, you need to select in the destination once again in order to insert the table there.
- Designer cuts the content of the table in some pages that cannot display if the height of the table is higher than that of the page; however, when you export the table to Excel with column format or data format, or to Text with delimited format, or to XML, Designer does not cut off any no content.
- When you create a table of the Group Above or Group Left type, by default, Designer aligns all the summaries of the same functions horizontally in the table. If you want to align them vertically, select Align summaries vertically in the Component category of the Options dialog box in advance.