How to use different data source connections to the subreport and main report data set in Jasper soft.
Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.
Prerequisites: Jasper Studio 6.4.0
Database: Foodmart, SugarCRM
In this blog, we will discuss how to use different data source connections to the subreport and data set.
Step 1: Create a subreport with employees details from the food mart database.
Step 2: Create the main report using SugarCRM database
Step 3: Create a parameter in main report and give class as “java.sql.Connection”.
Step 4: In the Default expression pass the below expression to get the connection from the different database.
java.sql.DriverManager.getConnection(“jdbc:postgresql://hostname:port/datbasename”,”username”,”password”)
Step 5: Drag and drop the subreport component from the palette select existing report.
Step 6: In the parameter, section map the parameter to the subreport.
Step 7: Normally the $P{REPORT_CONNECTION} parameter is used to pass the main report’s database to the subreport. Since we want to use a different database connection we need to use the parameter that will create a new database connection.
Step 8: Drag and drop the table from the palette in the main report and use SugarCRM Database.
Step 9: Now run the report and see the result as below.
Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.
Best Open Source Business Intelligence Software Helical Insight Here
A Business Intelligence Framework
Best Open Source Business Intelligence Software Helical Insight is Here