In my current project, I am working on some Jasper reports. I have a report which has 2 sub reports in it. I am exporting it to pdf file. If I export a normal jasper report which doesn't have any subreports, the pdf file is working perfectly, when I have subreports, the pdf file is blank. Following is my code:
static String reportPath = "D:/Netbeans Projects/Abc/mail_reports/";
public static void getReport() {
try {
String reportName = reportPath + "AuctionSale/AuctionSeller/AuctionSeller.jasper";
Map<String, Object> params = new HashMap<String, Object>();
params.put("sale_date", "2012-01-10");
JasperPrint jasperPrint = JasperFillManager.fillReport(reportName, params, DB.getConn());
OutputStream output = new FileOutputStream(new File("C:/JasperReport.pdf"));
JasperExportManager.exportReportToPdfStream(jasperPrint, output);
} catch (Exception e) {
e.printStackTrace();
}
}
Can anybody tell me where did I miss or what do I have to make the report work.
Thanks