eugene.doktorov Posted May 2, 2014 Share Posted May 2, 2014 Hi guys,I'm using Jaspersoft Studio 5.5.0I have a report which connects to MongoDB databaseI have a subreport which connects to a different MongoDB databaseWhen I intergrate the subreport into the report, I need to specify an alternative connection via "Use another connection" option in Subreport withard.I googled and found anwers for sql databases like the following: "Choose the Use another connection option and type java.sql.DriverManager.getConnection("jdbc:postgresql://localhost:5432/jasperdb5a", "postgres", "postgres")" expression in the area belowMy question is: What is the expression format for Mongo DB? Thank you!Eugene Link to comment Share on other sites More sharing options...
jasperUser12 Posted August 1, 2014 Share Posted August 1, 2014 Ok, so you need to follow these 3 steps:Add the jaspersoft mongodb driver jar to your build path (under project->properties->java build path->add external jar).Include this code in your jrxml - <import value="com.jaspersoft.mongodb.connection.*"/>Your subreport expression will be like this <connectionExpression><![CDATA[new com.jaspersoft.mongodb.connection.MongoDbConnection("mongodb://x.x.x.x:27017/xxx", "username", "password")]]></connectionExpression>Hope that helps! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now