Jump to content
Changes to the Jaspersoft community edition download ×

Blank pdf report created in output folder while exporting report designed using ireport


RamyaR

Recommended Posts

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


 


Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...