Creating a catalog

A report can only exist within a catalog. Therefore you must create and open a catalog before you create or edit a report.

A catalog is represented at the operating system level as a directory that contains the catalog file (.cat) as well as the other report objects.

To create a catalog:

  1. In JReport Designer, click File > Catalog Management > New Catalog on the menu bar.

    If necessary, JReport Designer will prompt you to save changes to the current open catalog. Only one catalog can be open at a time.

  2. In the New Catalog dialog, enter the name for the catalog in the Name field.
  3. In the Data Source Name field, input the name for the data source that will be created along with the catalog (when creating a catalog, by default, a data source will be created in the catalog at the same time). Make sure the name you give follows the Java class naming rule.
  4. Specify the path where to save the catalog in the Directory field. You can also click the button to browse to and select the directory in which to create the catalog.
  5. Click OK to create the catalog.

    The Catalog Browser displays with a data source created for the catalog. You can then set up the required connections to connect with the data source. A data source can be connected to multiple connections. For details about setting up connections, see Data Source Connections.

Note: The catalog name must include the extension (.cat or .xml) and the directory you choose must not already contain a catalog file.

JReport Designer supports the Multiple Data Sources feature, which means in one catalog, you can add as many data sources as you need.

To add another data source to a catalog, follow the steps below:

  1. Do either of the following:
  2. In the New Data Source dialog, specify a name for the data source in the Data Source Name field, select the connection type, then click OK.
  3. Set up the first connection in the data source according to your requirements.

When multiple data sources are created in a catalog, you need to specify which data source will be the default one for the catalog (by default, the data source that is created along with the catalog is the default data source of the catalog). To do this, right-click the data source which you want to use as the default data source, then click Set as Default on the shortcut menu. A catalog must have one and only one default data source.

In addition, you can rename and delete the data sources in a catalog if required.