Hi,
Im using Jdev 11.1.2.4.0 version
I designed a report in jasper iReport tool (version 5.5.0) to get a pdf file.
I have also used the required jar files. I was able to preview the pdf report in iReport , thus no error in the designed report.
And I didnt get any error while debugging the source but a BLANK pdf was exported in the mentioned output folder.
The below is the source code used:
String fileName = "Sample.pdf";
String jrxmlName = "sample.jrxml";
ApplicationModuleImpl appM = (ApplicationModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
StringBuilder reportSpoolFile = new StringBuilder();
reportSpoolFile.append(fileName);
Map<String,Object> param = new HashMap<String,Object>();
File reportFile = new File("D:\Jdev11gR1\mywork\Application6\ViewController\public_html\reports\" + jrxmlName);
InputStream input = new FileInputStream(reportFile);
JasperDesign design = JRXmlLoader.load(input);
JasperReport report = JasperCompileManager.compileReport(design);
PreparedStatement pre = appM.getDBTransaction().createPreparedStatement("commit", 1);
Connection conn = pre.getConnection();
JasperPrint print = JasperFillManager.fillReport(report, param, conn);
FileOutputStream fos = new FileOutputStream("D:\output\" + fileName);
JRPdfExporter exporter = new JRPdfExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, fos );
exporter.exportReport();
input.close();
fos.close();
Any configuration need to be done?
Please help me out from this issue.
Thanks,
Ramya