Jump to content
Changes to the Jaspersoft community edition download ×

Subreport problem

Recommended Posts

By: mandava - lakshmipmandava

Subreport problem

2002-08-22 02:21

I am calling the subreport in main report call depl,

<subreport isUsingCache="true">

<reportElement x="5" y="25" width="200" height="20" />

<subreportParameter name="repNameType1">








<subreportExpression class="java.lang.String">





but when i am loading the main report using web application, the below problem is saying


dori.jasper.engine.JRException: Could not load object from location : Depletions


at dori.jasper.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java


at dori.jasper.engine.util.JRLoader.loadReportFromLocation(JRLoader.java


at dori.jasper.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java


at dori.jasper.engine.fill.JRFillBand.evaluate(JRFillBand.java:224)

at dori.jasper.engine.fill.JRVerticalFiller.fillSummary(JRVerticalFiller


at dori.jasper.engine.fill.JRVerticalFiller.fillReportEnd(JRVerticalFill


at dori.jasper.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.


at dori.jasper.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:329)

at dori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:96)

at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.jav


at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.jav


at dori.jasper.engine.JasperRunManager.runReportToPdf(JasperRunManager.j


at DoPrintPdf.service(DoPrintPdf.java:65)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)

at org.apache.tomcat.core.Handler.invoke(Unknown Source)

at org.apache.tomcat.core.Handler.service(Unknown Source)

at org.apache.tomcat.facade.ServletHandler.service(Unknown Source)

at org.apache.tomcat.core.ContextManager.internalService(Unknown Source)


at org.apache.tomcat.core.ContextManager.service(Unknown Source)

at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(

Unknown Source)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown


at java.lang.Thread.run(Thread.java:536)


and i want to use CustomDataSource for subreport. how use?




By: Teodor Danciu - teodord

RE: Subreport problem

2002-08-22 02:50




Your "Depletions.jasper" file is not found.

That's because the path to it is not relative to the

path from where you have loaded the master report,

but to the current directory when starting the JVM.


The best way to deal with such scenarios is to put

your .jasper files in a directory structure that is

visible through Classpath, just like the other .class

files of your application.


You could load the master .jasper file using

JRLoader.loadObjectFromLocation(String location)

method and inside it, you can reference the

subreport file using the path to it inside the



Maybe I'll provide a sample that will explain how to

place resources like the .jasper files in the

Classpath and how to reference them.


I hope this helps.





By: mandava - lakshmipmandava

RE: Subreport problem

2002-08-22 02:43

i have 4 subreports called


1). ships report

2). deps report

3). netsales report

4) gross margin report


how to display all reports in single PDF file.


for each report i am using seprate custom datasource. how to display.




By: Teodor Danciu - teodord

RE: Subreport problem

2002-08-22 02:56




If the master report is only a container for the

subreports and does not have a data source of

its own, you can do it like this:


Place your 4 subreports one after the other on the

title section of the master report, using

positionType="Float" for each of them.


You pass the 4 data sources in the master report

as parameters, so that you can supply them to the

corresponding subreport.


When filling the master report, that has no data

of its own, use this data source:


new JREmptyDataSource()


I hope this is what you need.


Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

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