Setting up a MongoDB connection

To set up a MongoDB connection to connect a JReport catalog to a MongoDB data source, follow the steps below:

  1. Create a catalog which contains a default data source, then in the Data tab of the Catalog Browser, expand the node of the data source, right-click the Relational node and choose Add MongoDB Connection from the shortcut menu.

    If you want to set up the connection by adding a data source to an existing catalog and then defining the connection on the data source, open the catalog, select any data source contained in it, click the New Data Source button on the Catalog Browser toolbar, then in the New Data source dialog, specify the name of the data source, select the MongoDB connection type and click OK.

  2. In the MongoDB Connection Information screen of the MongoDB Connection Wizard, type in the host and port of the MongoDB server, and also the user ID and password to connect to the MongoDB server. Click Next.
  3. In the Connection Options screen, click to add a line for specifying the conditional replica set member for the MongoDB connection. If necessary, click to add a new replica set member. Click to remove a selected replica set member. Then specify the options for the connection. The Pre-join feature for building a query or defining join relationships in business cubes is enabled by default. Click Next.
  4. In the Add Database screen (this screen will be displayed only when you have no right to access all the databases in the MongoDB data source), click to add a line for specifying the databases you can access in the MongoDB data source. If necessary, click to add a new database. Click to remove a selected database. Click Next.
  5. In the Add Schema screen, add the collection schemas that will be transformed to relational schemas. Click Next.
  6. In the Add Table screen, add the required tables that are transformed from the relational schemas to the connection.
  7. Click Finish to confirm the transformed result and finalize the transformation process.

See also MongoDB Connection Wizard for additional help about options in the wizard.

Note: When setting up the connection via SSL, you need to import the SSL certificate into the default JKS, and use the -D parameter to specify the system parameter in the file JRServer.bat in <server_install_root>\server\bin (the MongoDB Java driver mongo-2.12.0.jar is already within JReport). Then add ssl=true in the Options box of the Connection Options screen of the MongoDB Connection Wizard.