I have two tables to be printed in same page. Data for those tables will be supplied from a map from a custom data source. I need to implement it. I googled for implementing
If you have only one detail band and your subreportExpression is something like "SUBREPORT_1.jasper" you can use this to compile several subreports
JRDesignBand jrBand = (JRDesignBand) jasperDesign.getDetailSection().getBands()[0];
JRElement[] jrElements = jrBand.getElements();
for (JRElement jrElement : jrElements) {
if (jrElement instanceof JRDesignSubreport) {
JRDesignSubreport subReportDesign = (JRDesignSubreport) jrElement;
JRExpression jrExpression = subReportDesign.getExpression();
String file = jrExpression.getText();
file = file.substring(1, file.length()-8)+".jrxml";
JasperCompileManager.compileReport(file);
}
}