oshan2csd
oshan2csd

Reputation: 433

How to connect a MongoDb atlas database with Jaspersoft studio

I'm developing a Java Spring boot application with MongoDb database (MongoDB Atlas) and trying to generate reports from backend with Jasper reporting services. I have followed several tutorials to do that. But all of them show how to connect to a local database. Since I'm using MongoDB Atlas I'm wondering how to give Mongo URI while setting up the Data Adapter (See image)

enter image description here

If anyone knows a better approach to generate reports without using Japer reporting, please mention that as well. Thanks in advance!

Upvotes: 0

Views: 848

Answers (1)

Afeef Janjua
Afeef Janjua

Reputation: 659

You need to have mongodb atlas properly setup before you can connect to it.

First click on Database Access under Security in mongo atlas dashboard and create a new user

enter image description here

Then click on Network Access again under Security and whitelist your IP. The following image allows anyone to connect to the db

enter image description here

Finally, go to your cluster and click connect and you will be presented the following dialog. Copy the connection string from it and paste it into your jaspersoft connected interface.

Make sure you replace the <password> with the password of the user created above

enter image description here

That should work!

UPDATE: here is a screenshot of successful connection to jasperreport studio

enter image description here

Upvotes: 1

Related Questions