Jump to content
Changes to the Jaspersoft community edition download ×

Empty PDF on using jrxml from Ireports


anantavijayguha

Recommended Posts

Hi,

I am using jrxml generated by ireports 2.0.0.

I have written the following java code and trying to run it.

Code:

public static void main(String[] args) {
JasperReport jasperReport;
JasperPrint jasperPrint;
try {
Class.forName("com.mysql.jdbc.Driver"«»).newInstance();
Connection con = DriverManager.getConnection("jdbc:mysql:///test",
"root", "security"«»);

jasperReport=JasperCompileManager.compileReport("reportXMLs/Untitled_report_1.jrxml"«»);
jasperPrint=JasperFillManager.fillReport(jasperReport,new HashMap(),con);
JasperExportManager.exportReportToPdfFile(jasperPrint,"reports/simpleReportwithPieChart.pdf"«»);
} catch (JRException e) { .......

 

There is no error on running. The PDF file created is blank.

When using JViewer Preview Pdf , the pdf is fine.

 

Any help will be useful.

Thanks in advance [file name=Untitled_report_example.jrxml size=6734]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/Untitled_report_example.jrxml[/file]

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...