rgent Posted July 31, 2008 Share Posted July 31, 2008 Good morning, I created a complex report which is composed of several subreports in which their also include subreports.So I wrote a level 2 or 3 subreports from the main report. I then tried the plugin ireport the integration of the report in the jasperserver. The integration is going well and it seems to retrieve subreports.but when I launch the report since jasperserver, I have this error: et.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Could not load object from location : .R_Fils_Demande_encours_de_Traitement_Maintenance.jasper net.sf.jasperreports.engine.JRException: Could not load object from location : .R_Fils_Demande_encours_de_Traitement_Maintenance.jasper it seems not find the subreports R_Fils_Demande_encours_de_Traitement_Maintenance.jasper which is a level 2 in the depth of subreports .. Thank you for your help Link to comment Share on other sites More sharing options...
swood Posted August 1, 2008 Share Posted August 1, 2008 It looks like you are referring to the subreports in the wrong way for JasperServer.In the JRXML, you would not refer to a subreport like that, nor would you use a .jasper.In the JasperServer report unit, add the sub report JRXMLs as resources, and when you refer to the subreports in JRXML, use the "repo:" syntax. ShermanJaspersoft Link to comment Share on other sites More sharing options...
kadimulam Posted March 24, 2009 Share Posted March 24, 2009 Hi swood,I tried your solution, but i recevied the following error:Error loading object from URL : repo:CHSSub.jrxmlPlease help me in resolving this error.Thanks,Kiran Link to comment Share on other sites More sharing options...
anandharaj Posted March 25, 2009 Share Posted March 25, 2009 repo: so it is not necessary actual file name. What is the ID you define when upload the JRXML file? that is the name you need to put there Link to comment Share on other sites More sharing options...
steenvoorden Posted October 22, 2010 Share Posted October 22, 2010 I ran into the same problem.In iReport I use a template to base my reports on (with all parameters defined and the SUBREPORT_DIR defined as default value ".\\". The report with nested subreports work fine. However when I transfer it to a server I get the same message.I solved it by passing the SUBREPORT_DIR parameter from the mainreport to the parameter in the subreport and further from the subreport to subreports at deeper levels.Ruud Link to comment Share on other sites More sharing options...
asmithndreww Posted July 29, 2011 Share Posted July 29, 2011 Dear Sir,At the moment I am facing the given problem. I have designed a mainreport with an subreport. This report is executing fine throughiReport interface.But When I am execute this report from my java application I got thegiven error. Please help me. I am in trouble.Please anyone help me.*********************************************************************net.sf.jasperreports.engine.JRException: Could not load object fromlocation : \netIncomeStatement_subreport0.jasper atnet.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:271) atnet.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:324) atnet.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:273) atnet.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:275) atnet.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:426) atnet.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1380) atnet.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:692) atnet.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:255) atnet.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:113) atnet.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:899) atnet.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:802) atnet.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63) atnet.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:421) atjamshedCement.repNetIncomeStatement.jButton4ActionPerformed(repNetIncomeStatement.java:362) at jamshedCement.repNetIncomeStatement.access$200(repNetIncomeStatement.java:29) at jamshedCement.repNetIncomeStatement$3.actionPerformed(repNetIncomeStatement.java:195) atjavax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) atjavax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) atjavax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) atjavax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6038) at javax.swing.JComponent.processMouseEvent(JComponent.java:3260) at java.awt.Component.processEvent(Component.java:5803) at java.awt.Container.processEvent(Container.java:2058) at java.awt.Component.dispatchEventImpl(Component.java:4410) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Component.dispatchEvent(Component.java:4240) atjava.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322) atjava.awt.LightweightDispatcher.processMouseEvent(Container.java:3986) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916) at java.awt.Container.dispatchEventImpl(Container.java:2102) at java.awt.Window.dispatchEventImpl(Window.java:2429) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) atjava.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) atjava.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) atjava.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) atjava.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) atjava.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)*********************************************************************My Java coding is&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&String reportSource = "./libr/templates/netIncomeStatement.jrxml";String reportDest = "./libr/results/netIncomeStatement.html";Map<String, Object> params = new HashMap<String, Object>();params.put("date1", jCalendarCombo1.getSelectedDate().toString());params.put("date2", jCalendarCombo2.getSelectedDate().toString());//params.put("cashPreviousBal", preBalTxt.getText());//params.put("financialyear", finidstr);//params.put("SUBREPORT_DIR", 5);//Map parameters = new HashMap();//parameters.put("SUBREPORT_DIR", "C:/Program Files/JasperSoft/iReport-3.0.0");try { JasperReport jasperReport = JasperCompileManager.compileReport(reportSource); // Make the driver class available. Class.forName(jdbcDriver); // Create a connection to pass into the report. Connection conn = DriverManager.getConnection(url);//new File("C:/Program Files/JasperSoft/iReport-3.0.0/netIncomeStatement_subreport0.jasper").exists(); // Replace the empty JR datasource parameter with // the connection parameter named conn. JasperPrint jasperPrint = JasperFillManager.fillReport( jasperReport, params, conn); JasperExportManager.exportReportToHtmlFile( jasperPrint, reportDest); // JasperFillManager.fillReportToFile("C:/Program Files/JasperSoft/iReport-3.0.0/netIncomeStatement_subreport0.jasper",parameters ); JasperViewer.viewReport(jasperPrint,false); } catch (JRException e) { e.printStackTrace(); } // Exception handling for the Class.forName method. catch (ClassNotFoundException ex) { ex.printStackTrace(); } // Exception handling for the DriverManager.getConnectionmethod. catch (SQLException ex) { ex.printStackTrace(); }&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&Thanks in advance.RegardsSmith 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