To set up an XML connection to connect a JReport catalog to an XML data source, follow the steps below:
If you want to set up the connection in a new data source in the catalog, select any of the existing catalog data sources, click New Data Source on the Catalog Manager toolbar, then in the New Data source dialog, specify the name of the data source, select the XML connection type and click OK.
The XML Connection Wizard appears.
In the URI string, you can reference parameters and constant level formulas in the current catalog data source and the special field User Name in the format "@fieldname". For example, if a URI string is http://localhost:8080/rest/getData?startDate=2016-01-01
, and you want to use the parameters pHost, pPort and pStartDate to dynamically generate the URI at runtime, then the URI string will be http://@pHost:@pPort/rest/getData?startDate=@pStartDate
. Moreover, if a URI string contains characters, such as @, '.' or double quotation marks, or other strings that do not need to be parsed, quote them with double quotation marks. If needed, you can click New Parameter to create a parameter in the current catalog data source and reference it in the URI string. If the special field User Name is used, when clicking Next in the connection wizard, the Security Identifier dialog will pop up for you to specify the user name with which to generate the stream in Designer. When run on JReport Server, the real user's ID will be used.
http://
or https://
protocol, the RESTful button is activated. Click it to specify the RESTful options for the schema file in the RESTful Data Source Options dialog.
When Via REST Web Service is unchecked, the remote data will be received via the protocol in the URL you specify in the Schema Name text field in the connection wizard.
To use an instance file from URI, check the URI radio button, then input the URI string directly in the Instance text field or click Browse to select the instance file. You can also reference parameters, constant level formulas and the special field User Name in the URI string. When the specified URI string begins with http://
or https://
protocol, the RESTful button is activated. Click it to specify the RESTful options for the instance data.
To use an instance file from a user defined interface, check User Defined, then 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 enter must exist and can be found by JReport Designer and JReport Server at runtime, 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:. Then specify the parameter string for the user defined interface in the Parameter box. The parameter string must match the format defined in the class. You can also reference parameters, constant level formulas, and the special field User Name in the parameter string.
Notes:
http://
or https://
protocol, the RESTful button is activated. Click it to specify the RESTful options for the instance data.