Jump to content
Changes to the Jaspersoft community edition download ×

Inserting a subreport


2004 IR Help

Recommended Posts

By: bst05 - bsharp05

Inserting a subreport

2005-12-22 07:20

Greetings,

 

I really hope someone has encountered a similar problem as this one. I have a main report and I am trying to include a sub report. The main report passes in a list, the subreport however executes a database query within the subreport itself. I am passing the connection as a parameter into the main report as -

 

parameters.put("subreportJrxml",path+"/subreport.jrxml");

parameters.put("subreportConnection",conn);

 

In the main report jrxml I have these parameters defined as parameters as well. I also have the connectionExpression set to $P{subreportConnection} and the expression is $P{subreportJrxml}

 

The subreport simply does a simple query. No paremeters are being defined or return values. There is only one field being outputed in the subreport.

 

Lastly, the subreport works if I run it independantly on it's own, without inserting it as a subreport into the main report. So for some reason the link between the main report and subreport seems to be causing an issue.

 

Here is the error I get in Tomcat:

 

java.io.StreamCorruptedException: invalid stream header

at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:737

)

at java.io.ObjectInputStream.<init>(ObjectInputStream.java:253)

at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:84

)

at net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLo

ader.java:244)

at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubre

port.java:314)

at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFi

llElementContainer.java:211)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVe

rticalFiller.java:1307)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVertic

alFiller.java:639)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRV

erticalFiller.java:230)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVertic

alFiller.java:128)

at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:

826)

at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89

)

at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillMa

nager.java:428)

at com.rodale.webapp.util.BSTJasperReportWrapperHibernate.createReportWi

thHibernateQueryResult(BSTJasperReportWrapperHibernate.java:194)

at com.rodale.webapp.action.FulfillmentAction.genReport(FulfillmentActio

n.java:458)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchActio

n.java:276)

at com.rodale.webapp.action.BaseAction.execute(BaseAction.java:220)

at org.apache.struts.action.RequestProcessor.processActionPerform(Reques

tProcessor.java:421)

at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja

va:226)

at org.apache.struts.action.ActionServlet.process(ActionServlet.java:116

4)

at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)

 

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

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

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:237)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:157)

at com.rodale.webapp.filter.GZIPFilter.doFilter(GZIPFilter.java:51)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:186)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:157)

at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrid

eFilter.java:125)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:186)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:157)

at org.springframework.web.filter.CharacterEncodingFilter.doFilterIntern

al(CharacterEncodingFilter.java:75)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR

equestFilter.java:76)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:186)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:157)

at com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFi

lter.java:42)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:186)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:157)

at com.rodale.webapp.filter.ActionFilter.doFilter(ActionFilter.java:119)

 

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:186)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:157)

at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.do

FilterInternal(OpenSessionInViewFilter.java:172)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR

equestFilter.java:76)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:186)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:157)

at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilte

r(FilterChainProxy.java:292)

at net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(F

ilterSecurityInterceptor.java:84)

at net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter

(SecurityEnforcementFilter.java:182)

at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilte

r(FilterChainProxy.java:303)

at net.sf.acegisecurity.providers.anonymous.AnonymousProcessingFilter.do

Filter(AnonymousProcessingFilter.java:153)

at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilte

r(FilterChainProxy.java:303)

at net.sf.acegisecurity.wrapper.ContextHolderAwareRequestFilter.doFilter

(ContextHolderAwareRequestFilter.java:50)

at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilte

r(FilterChainProxy.java:303)

at net.sf.acegisecurity.context.HttpSessionContextIntegrationFilter.doFi

lter(HttpSessionContextIntegrationFilter.java:225)

at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilte

r(FilterChainProxy.java:303)

at net.sf.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.

java:173)

at net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProx

y.java:125)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:186)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:157)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV

alve.java:214)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv

eContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav

a:520)

at org.apache.catalina.core.StandardContextValve.invokeInternal(Standard

ContextValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV

alve.java:152)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv

eContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav

a:520)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j

ava:137)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv

eContext.java:104)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j

ava:118)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv

eContext.java:102)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav

a:520)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal

ve.java:109)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv

eContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav

a:520)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

 

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:16

0)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java

:799)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce

ssConnection(Http11Protocol.java:705)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java

:577)

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

ool.java:683)

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

 

 

 

 

 

 

 

 

 

 

By: bst05 - bsharp05

RE: Inserting a subreport

2005-12-22 07:31

Figured it out. I was passing in the jrxml file as the parameter instead of the actual jasper file.

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