aziziyazit Posted April 11, 2009 Share Posted April 11, 2009 Hello guys!I am in the urgent situation here. I have designed and compile my chartExample.jrxml to chartExample.jasper.However when I run the jasper through my webapp it just display a blank/empty pdf file.- I can display the *.txt, *.rtf and *.pdf however when run chartExample that contain chart, it appeared blank. Azizi YazitCode:...else if(formBean.getFmt().equals("chartP")){ response.setContentType("application/pdf"); response.addHeader("Content-disposition", "attachment; filename=" + filename.toString() + ".pdf"); try{ JasperReport jasperReport = (JasperReport)JRLoader.loadObject(getClass().getClassLoader().getResourceAsStream(reportName)); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, HibernateUtil.currentSession().connection()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); } catch (JRException e) { e.printStackTrace(); } } Link to comment Share on other sites More sharing options...
lucianc Posted April 14, 2009 Share Posted April 14, 2009 aziziyazitWrote: Anything in the server logs?Regards,Lucian Link to comment Share on other sites More sharing options...
aziziyazit Posted April 20, 2009 Author Share Posted April 20, 2009 @Lucian Thanks for the quick reply. My problem has been solved. It appeared blank because wrong input in parameter inside iReport. If I am wrong, please correct me. If report appear blank it's because wrong user input or input from user is not suit with query? I have do googling a lots, and I found that, if we want generate a chart image, we better use JFreeChart through java code. And if we want report contains chart, we can use jasper report through iReport. Azizi Yazit. Link to comment Share on other sites More sharing options...
lucianc Posted April 21, 2009 Share Posted April 21, 2009 aziziyazitWrote: If report appear blank it's because wrong user input or input from user is not suit with query? Yes, if the report query doesn't return any data the report would be by default blank.Regards,Lucian Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now