2004 IR Help Posted August 24, 2006 Share Posted August 24, 2006 By: raf78 - raffeo Help Subreport 2005-11-11 05:00 Hi! Sorry for my English. I create a report with a subreport in Ireport. I compile and run it and it's ok After i create a java class to can print master report but when i compile i receive this error Error loading object from file : c:test.jasper Test.jasper is subreport jasper file My Java code is public void print_report(ResultSet tmp_res) { String xmlFileName = "c:\test.jrxml"; jasperFileName = "c:\test.jasper"; JRDataSource jrds = new JRResultSetDataSource( tmp_res); try { JasperCompileManager.compileReport(xmlFileName); // JasperCompileManager.compileReportToFile(xmlFileName, // jasperFileName); } catch (JRException ex1) { System.out.println(ex1.getMessage()); } HashMap map = new HashMap(); net.sf.jasperreports.engine.JasperPrint print = null; try { print = JasperFillManager.fillReport(report, map, jrds); new JasperPrintManager().printReport(print, true); } catch (JRException ex) { System.out.println(ex.getMessage()); } } Can help me? Thanks By: jorge - sirion_oef RE: Help Subreport 2005-11-11 15:33 what line throws the exeption? this line: JasperCompileManager.compileReport(xmlFileName); try this: JasperReport report; //out of the try report = JasperCompileManager.compileReport(xmlFileName); 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