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

Problem : integration report in jthe jasperserver


rgent

Recommended Posts

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

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

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.

 

Sherman

Jaspersoft

 

Link to comment
Share on other sites

  • 7 months later...
  • 1 year later...

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

  • 9 months later...

Dear Sir,

At the moment I am facing the given problem. I have designed a main
report with an subreport. This report is executing fine through
iReport interface.

But When I am execute this report from my java application I got the
given error. Please help me. I am in trouble.
Please anyone help me.

******************************

***************************************
net.sf.jasperreports.engine.JRException: Could not load object from
location : \netIncomeStatement_subreport0.jasper
       at
net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:
271)
       at
net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:
324)
       at
net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:
273)
       at
net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:
275)
       at
net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:
426)
       at
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:
1380)
       at
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:
692)
       at
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:
255)
       at
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:
113)
       at
net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:
899)
       at
net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:
802)
       at
net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63)
       at
net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:
421)
       at
jamshedCement.repNetIncomeStatement.jButton4ActionPerformed(repNetIncomeStatement.java:
362)
       at jamshedCement.repNetIncomeStatement.access
$200(repNetIncomeStatement.java:29)
       at jamshedCement.repNetIncomeStatement
$3.actionPerformed(repNetIncomeStatement.java:195)
       at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:
1995)
       at javax.swing.AbstractButton
$Handler.actionPerformed(AbstractButton.java:2318)
       at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:
387)
       at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
       at
javax.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)
       at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
       at
java.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)
       at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:
273)
       at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:
183)
       at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:
173)
       at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
       at
java.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.getConnection
method.
       catch (SQLException ex)
       {
           ex.printStackTrace();
       }

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


Thanks in advance.

Regards

Smith
Link to comment
Share on other sites

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