Jump to content
We've recently updated our Privacy Statement, available here ×

creating report from java fails with errors


jdeppuser

Recommended Posts

I found code to produce a report via java code and thought this would be easily possible but found too many errors occurring. I am able to create a report from a template using the normal procedural steps but programmatically it fails. This is critical as i need to be able to query the DB and render the reports automatically on a schedule.

 

 

net.sf.jasperreports.engine.JRException: java.io.FileNotFoundException: C:UsersmmmDocumentsworkspace-sts-webappsHelloJasperfirstReport.jrxml (The system cannot find the file specified)

 

  JRResultSetDataSource rsdt=new JRResultSetDataSource(rs);                                     JasperReport jrpt = JasperCompileManager.compileReport("C:\Users\mmm\Documents\workspace-sts-webapps\HelloJasper\firstReport.jrxml");                          //InputStream is=this.getClass().getResourceAsStream("firstReport.jrxml");             //jrpt = JasperCompileManager.compileReport(is);                                       JasperPrint jp = JasperFillManager.fillReport(jrpt, new HashMap(), rsdt);             JasperViewer jv = new JasperViewer(jp);             jv.setVisible(true);             [/code]

 

Now when I actually add the report first using one of the templates, I get another error:

 

et.sf.jasperreports.engine.JRException: Error compiling report java source files: C:UsersmmmDocumentsworkspace-sts-websHelloJasperfirstReport_1473970204847_393001.java 

 

 

Link to comment
Share on other sites

  • Replies 2
  • 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...