Adding a UDS to a catalog

To add user defined data sources to a catalog, follow the steps below:

  1. Open the catalog to which you want to add the UDS.
  2. In the Data tab of the Catalog Browser, right-click the data source to which the UDS is to be added, then select Add User Defined Data Source from the shortcut menu. The Add User Defined Data Source dialog appears. See the dialog.
  3. In the Name field, specify a name for the UDS as required.
  4. Provide the class name with package name in the Class Name field. You can also click Browse to find the class file. The class you entered should actually exist and can be found by JReport Designer, which means the class should be in the class path of the system environment. After filling in this field, the class name of the interface that the class implements will be displayed automatically behind The class implements:.
  5. Specify the parameter for the UDS in the Parameter box. The parameter string must match the format defined in the UDS class. You can use parameters or constant level formulas predefined in a JReport catalog or the special field UserName in the parameter string, and the format of the predefined parameters used in the string is "@" + parameter name. For example, if the parameter string of a UDS is SQL=select * from employee, and you want to use the parameter sql in a catalog to replace the part after "=" in the string, then the parameter string of the UDS will be SQL=@sql.
  6. Check the Specify Columns option to enable the column definitions list and add column definitions. If you don't specify the column definitions, JReport will get them from the result set automatically.
  7. Click OK to add the UDS.

See also the examples in Developing reports from UDS for details about how to add some specific UDS to a catalog.

Note: JReport Designer supports the Dynamic UDS feature. This feature improves performance significantly by retrieving the selected fields. At runtime, an option is provided for you to pick up the columns you want to see in the report. Also, JReport Designer will generate dynamic report according to user's selection. For details, see Example 4: Developing reports with dynamic UDS.