BackPrevious Page Next PageNext

Managing Tables in an XML Connection

Adding tables

Refreshing tables

Organizing tables

Removing and adding columns to tables

A table contains fields mapped to attributes, simple elements, contents of complex elements, and other nodes in XML files. Queries and business views can be built on these tables and a report is developed from a query (or something else which is functionally similar) or from a business view.

This document shows how to add more tables transformed from the XML data source into the JReport catalog via the XML connection, organize the tables, and so on.

Adding tables

  1. Do one of the following:

    The Add Tables dialog appears.

    Add Tables dialog

  2. Click the Refresh button. The tables contained in the schema that is transformed from the XML file will then be displayed in the Tables box.
  3. Choose the required tables in the Tables box, and then click Add.

    To choose consecutive tables, click the first table, press and hold down the SHIFT key, and then click the last table. To choose tables that are not consecutive, press and hold down CTRL, and then click each table.

  4. After adding the required tables, click Done to close the dialog.

Refreshing tables

The tables in your catalog are a temporary deposit to improve the performance when you design and test your report. Your data source keeps changing over the time; however, these will not be reflected automatically in your catalog. To synchronize your tables in the connection and data source, you can choose to refresh the table information using the Refresh command on the shortcut menu of the tables. When the refreshing job is done, a reporting dialog will be shown, summarizing the changes and operations that have been taken.

Organizing tables

You can organize the tables in an XML connection by arranging them in different folders in the Catalog Manager.

To add a folder:

  1. Do either of the following:
  2. A new folder is added to the Tables node, or in the selected folder. Type a name for the folder in the editing area, and then click outside to confirm the change.

To move tables to a folder:

  1. Right-click the table you want to move and select Move To from the shortcut menu.
  2. In the Move Table dialog, select the folder to which the table will be moved, then click OK.

    Move Table dialog

Removing and adding columns to tables

By default, when you add a table, you add all the columns that reside in the table; however, JReport gives you the flexibility to remove columns in a table, leaving only the columns useful to your reports. To remove a column from a table, right-click the column and select Delete from the shortcut menu.

Also, you can add the columns back into a table after you have removed them. To do this:

  1. Right-click the table to which you want to insert columns, then select Add Columns from the shortcut menu.
  2. In the Add Columns dialog, select the required columns from the Columns box and click Add.

    Add Columns dialog

    There will be no available columns in the Columns box if you did not delete any in the table.

  3. Click the Done button to close the Add Columns dialog.

Tip: If you want to add all the columns in a table at one time, you can also choose to refresh the table, which synchronizes the table in the catalog with the one in your XSD.

BackPrevious Page Next PageNext