Adding a UDS to a Catalog
Logi JReport Designer can access data from an external user defined data source, such as a text file, or Excel file, which is not stored in a database, or when there is no JDBC driver available.
To add a UDS to a Logi JReport catalog, follow the steps below:
- Create a catalog or open a catalog, then in the Catalog Manager, right-click the node of a data source and choose New User Defined Data Source from the shortcut menu.
If you want to add the UDS to a new data source in the catalog, select any of the existing catalog data source, select New Data Source on the Catalog Manager toolbar, then in the New Data source dialog, specify the name of the data source, select the User Defined connection type and select OK.
The New User Defined Data Source dialog appears.
- In the Name field, specify a name for the UDS as required.
- Provide the class name with package name in the Class Name field. You can also select Browse to find the class file. The class you enter must exist and can be found by Logi JReport Designer, which means the class should be in the class path of the system environment or set in ADDCLASSPATH of setenv.bat/setenv.sh. After filling in this field, the class name of the interface that the class implements will be displayed automatically behind The class implements:.
- Specify the parameter for the UDS in the Parameter box. The PARAMETER string must match the format defined in the UDS class. You can reference parameters and constant level formulas predefined in the current catalog data source and the special field User Name in the PARAMETER string in the format "@fieldname". For example, if the PARAMETER string of a UDS is
SQL=select * from employee, and you want to use the predefined parameter sql to replace the part after "=", then the PARAMETER string will be
SQL=@sql. If the special field User Name is used, to specify the user name, select Options on the Catalog Manager toolbar, in the General category of the Options dialog, set the User Name option.
- When parameters and formulas are referenced in the PARAMETER string, you can select the Edit Format button to edit the format of their values.
- Check the Specify Columns option to enable the column definitions list and add column definitions. If you don't specify the column definitions, Logi JReport will get them from the result set automatically.
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', and so on.
The data type of the column.
- Precision, Length, Scale, Radix
The default value for each SQL type. Select the cell and modify the value if necessary.
Indicates whether the value of the column can be null. X stands for NoNulls, √ stands for Nullable and ? stands for Nullable Unknown.
- Select OK to add the UDS.
The following examples show how to add some specific UDS to a catalog: