Tables/Views

Tables and views are mapped objects of the tables and views in the raw database that a connection refers to. Mapped objects have mapped names that can be different from their names in the raw database. A catalog stores information about the real tables/views mapped, such as the name, qualifier, and owner.

Since tables/views are only mapped objects, they can be mapped and then re-mapped. That is, the information of the real tables/views stored in a catalog is changeable. This is useful when you are off-line from your database. You will still be able to see the table structure and generate reports. In addition, when changing the connection, for example, from an Access database to an Interbase, you will only need to re-map all the tables/views in the catalog as opposed to creating a new catalog.

Adding tables/views to a catalog

The way to add tables and views stored in the database to a catalog via the JDBC connection you set up is the same. Below is the procedure for adding tables, and you can take the same steps to add views to a catalog.

To add tables to a catalog:

  1. Do either of the following:

    The Add Table dialog appears. See the dialog.

  2. From the Database Catalogs drop-down list, select the required catalog, then specify a schema in the selected catalog from the Schemas box.
  3. Click the Load Tables button. The tables contained in the selected schema will then be displayed in the Tables box.
  4. Check the Include System Tables option if you want to have the system tables available in the Tables box.
  5. Check Include Added Table to make the tables that have been added to the connection available in the Tables box.
  6. Choose the required tables in the Tables box, and then click Add.

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

  7. Repeat steps 2 to 4 to add tables from other catalogs and schemas.
  8. To add certain tables by name or by patterns in their name, select the Table Name Pattern checkbox. The wildcard % will then be displayed in the text box.

    For example, if you want to add tables beginning with AL, you can type AL% (case sensitive) in the text box, and click the Load Tables button. All the tables beginning with AL in the selected schema will then be displayed in the Tables box. Choose the tables that are required by clicking Add. They will then be added to the connection.

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

Notes:

Refreshing tables/views

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

Organizing tables/views

You can organize the tables/views, which have been added to a catalog via a JDBC connection, by arranging them in different folders in the Catalog Browser.

To add a folder:

  1. Right-click the Tables/Views node, or any existing folder and select Add Folder from the shortcut menu.
  2. A new folder is added to the Tables/Views 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/views to a folder:

  1. Right-click the table/view you want to move in the Tables/Views node and select Move To from the shortcut menu.
  2. In the Move Table/View dialog, select the folder to which the table/view will be moved, then click OK.
Removing and adding columns to tables/views

By default, when you add a table/view, you add all the columns reside in the table/view. However, JReport gives you the flexibility to remove columns in a table/view, leaving only the columns useful to your reports. Additionally, your database keeps changing over the time. You can add the columns to the table after you delete them or the database has been updated.

To remove a column from a table/view:

  1. Select the column you want to remove.
  2. Right-click the column and select Delete from the shortcut menu.

To add columns to a table/view:

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

    There will be no available column in the Columns box if you do not delete any in the table/view before, or no update has been made to the database. That is to say, you cannot add columns that do not belong to the table/view.

  3. Click the Done button to add the columns to the table/view.

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

Previewing the column data of tables/views

In the Catalog Browser, you can preview the data for a database column, which enables you to have a general idea about the field contents, field type, and other useful information related to this field.

To preview the data of a column:

  1. Right-click the column with the data you want to preview, then on the shortcut menu, click Browse Data.
  2. The data of this column is shown in a list in a dialog, which also includes other information including the field type, precision, scale and number of records.