Logi JReport Designer requires access to your data source to retrieve data for reports, so before you can create reports in Logi JReport Designer you need to set up a connection to your data source. Connections are defined, named, and stored in the catalog along with the reports and other resources that use them.
Logi JReport Designer supports the following connection types:
|JDBC||Connects to a relational database via a JDBC driver.|
|JSON||Connects to a JSON data source and transforms the schemas in the data source to relational schemas.|
|XML||Connects to and transforms an XML hierarchy model to a relational model.|
|SOAP Web Service||Connects to a SOAP Web Service data source by importing a WSDL file. Logi JReport Designer supports SOAP Web Services defined by WSDL 1.1 or WSDL 2.0 as data sources.|
|MongoDB||Connects to a MongoDB database and transforms the collections in the database to relational schemas.|
|Hive||Connects to a relational database stored in a Hive data warehouse via a JDBC connection.|
|Elasticsearch||Connects to an Elasticsearch data source and transforms the schemas in the data source to relational schemas.|
|User Defined||Through the User Data Source API, Logi JReport Designer can access data from an external 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.|
|Hierarchical||Logi JReport Designer directly supports XML format data source by wrapping the provided Hierarchical Data Source API. Logi JReport Designer's built-in classes can implement the XML format hierarchical data source interface. You can directly import an XML data source to a catalog.|
For detailed information about each connection type, see Data Source Connections.
In the following example, we will connect to a fictitious SQL Server database named SQLData, which runs on a server with the host name db.example.com. The user name and password used to access the database are dbuser and test1234 respectively. To connect a relational database to Logi JReport Designer, generally you need to install the JDBC driver for the database and append its class path to Logi JReport Designer's environment configuration file first, then in Logi JReport Designer connect a catalog to the database by setting a JDBC connection. Logi JReport Designer provides connection plugins for the most commonly used relational databases: Oracle, MySQL, SQL Server and PostgreSQL, for an easy connection setup procedure. Since we are using SQL Server in this example, we do not need to bother installing the driver as it has been included in the plugin.
- Select JReport Designer in the JReport folder on the Start menu to start Logi JReport Designer.
- On the Start Page, select SQL Server in the Connect category.
- In the Create Connection to SQL Server dialog, check the New Catalog radio button, specify the catalog name as SQLDemo.cat, then select OK.
You can set up connections in an existing catalog or in a new catalog. Here we chose to create a new catalog for the SQL Server database since it's our first database connection.
- In the prompted warning message, select Yes to save the current running catalog if necessary. The Connect to SQL Server dialog appears.
- Input the following database information in the dialog:
- Select Test Connection to test whether the information you provide is correct.
- If the database has special requirements such as the date format, select the More Options button to modify the options according to your requirements.
- Select OK. The Catalog Manager is then displayed, showing the connection in the resource tree. At the same time, Logi JReport Designer prompts you to choose what you want to do next (if the dialog does not show up, select Resume on the Catalog Manager toolbar).
- Select Add Tables in the Add Tables/SQL dialog to add tables stored in the database into the Logi JReport catalog.
- In the Add Tables/Views/Synonyms dialog, select
the required database catalog, schema and select the Refresh button to load the tables, then select the tables you want to add to the Logi JReport catalog and select Add.
- Repeat this to add tables from other database catalogs and schemas.
- Check the Views/Synonyms radio button to add views/synonyms from the database if it contains in the same way.
- Select Done to finish adding tables.
The tables are now added into the catalog resource tree and Logi JReport Designer prompts that you can use them to create queries or business views, which are the data sources used for creating reports in Logi JReport Designer.
- The names of the added tables in the catalog resource tree are the same as those in the database. You can edit them to something more meaningful. To do this, close the prompted dialog, then right-click a table and select Rename on the shortcut menu.
- The name text box becomes editable now. Input the new name and press Enter on the keyboard to confirm the change.