### 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, expand the data source to which the UDS is to be added, then right-click the User Defined node and select Add User Defined Data Source from the shortcut menu to bring up the Add User Data Source dialog. 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 parameters for the UDS in the Parameters box. The parameter string must match the format defined in the UDS class. You can use parameters predefined in a JReport catalog in the parameter string, and the format 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.
   - Name
     The name of a column. It should have the same validation with a common table column. The default names for column definitions are ‘column1', ‘column2'… etc.
   - SQLType
     The data type of the column.
   - Precision, Length, Scale, Radix
     The default value for each SQL type. Click the cell and modify the value if necessary.
   - Nullable
     Indicates whether the value of the column can be null. X stands for NoNulls, √ stands for Nullable and ? stands for Nullable Unknown.
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.