2001 JI Open Discussion Posted August 15, 2006 Share Posted August 15, 2006 By: Ken Holzer - kholzer Invalid page index : 0 of 0 2002-07-08 12:32Hi, I am getting the following error when I try to run a report with subreports. I am passing the main report a result datasource and my connection as a parameter. I then pass my sub reports two parameters (one is a Long and the other is a Date) Any ideas what the error means: dori.jasper.engine.JRException: Invalid page index : 0 of 0 at dori.jasper.engine.print.JRPrinterAWT.printPageToImage(JRPrinterAWT.java:223) at dori.jasper.engine.print.JRPrinterAWT.printPageToImage(JRPrinterAWT.java:107) at dori.jasper.engine.JasperPrintManager.printPageToImage(JasperPrintManager.java:438) at dori.jasper.view.JRViewer.refreshPage(JRViewer.java:749) at dori.jasper.view.JRViewer.cmbZoomActionPerformed(JRViewer.java:642) at dori.jasper.view.JRViewer.access$900(JRViewer.java:40) at dori.jasper.view.JRViewer$10.actionPerformed(JRViewer.java:407) at javax.swing.JComboBox.fireActionEvent(JComboBox.java:871) at javax.swing.JComboBox.selectedItemChanged(JComboBox.java:895) at javax.swing.JComboBox.contentsChanged(JComboBox.java:947) at javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:85) at javax.swing.DefaultComboBoxModel.setSelectedItem(DefaultComboBoxModel.java:92) at javax.swing.JComboBox.setSelectedItem(JComboBox.java:415) at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:456) at dori.jasper.view.JRViewer.<init>(JRViewer.java:118) at com.healthybenefit.common.ReportsViewer.<init>(ReportsViewer.java:67) at com.healthybenefit.common.ReportsViewer.viewReport(ReportsViewer.java:178) at com.healthybenefit.common.ReportsRunManager.runReportToViewDS(ReportsRunManager.java:105) at com.healthybenefit.actions.ReporterAction.execute(ReporterAction.java:152) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:437) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:264) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1161) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:471) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:159) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:106) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:499) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:278) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:105) at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:67) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:123) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67) at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:106) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:125) at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315) at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60) at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:313)[02.07.08 14:35:33:265 CDT] 50a6d5fa WebGroup I SRVE0091I: [servlet LOG]: action: Forwarding to 'success' page - action=PreviewReport at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:242) at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122) By: Teodor Danciu - teodord RE: Invalid page index : 0 of 0 2002-07-10 09:47 Hi, This message shows that the generated document you are trying to view has zero pages. Such an empty document is produced when the data source of the report has no rows. Check the ResultSet data source that you are passing to your main report. The problem seems to come from there. I hope this helps. Teodor By: Ken Holzer - kholzer RE: Invalid page index : 0 of 0 2002-07-10 11:59Thanks Teodor, I found my error (had the wrong date). Another question: I am passing a Long and Date as parameters to my subreports, but I get a query execute error and it shows ? where my parameter values were. Here is a paritial copy of my XMLs: Master: <subreport isUsingCache="true"> <reportElement x="5" y="0" width="530" height="0" positionType="Float"/> <subreportParameter name="MemNo"> <subreportParameterExpression> $F{c_CustNo} </subreportParameterExpression> </subreportParameter> <subreportParameter name="PDate"> <subreportParameterExpression> $F{cp_Date} </subreportParameterExpression> </subreportParameter> <connectionExpression> $P{REPORT_CONNECTION} </connectionExpression> <subreportExpression class="java.lang.String"> $V{FilePath} + "WarmUpPresc.jasper" </subreportExpression> </subreport> SubReport: <parameter name="MemNo" class="java.lang.Long"/> <parameter name="PDate" class="java.sql.Timestamp"/> <queryString><![CDATA[sELECT tblCust_Prescription.cp_Activity, tblCust_Prescription.cp_Duration, tblCust_Prescription.cp_Rep FROM tlkpActivitySubGrp INNER JOIN tblCust_Prescription ON tlkpActivitySubGrp.asg_ID = tblCust_Prescription.cp_ActivitySubGrp WHERE (((tblCust_Prescription.cp_CustNo)=$P{MemNo}) AND ((tblCust_Prescription.cp_Date)=$P{PDate}) AND ((tlkpActivitySubGrp.asg_SubGroup)='Warm Up' Or (tlkpActivitySubGrp.asg_SubGroup)='Warm Up/Cool Down')); ]]></queryString> Any Ideas, Thanks, Ken By: Teodor Danciu - teodord RE: Invalid page index : 0 of 0 2002-07-16 02:01 Hi, Send me the exception thrown on the console. I suppose there is an SQLException in the stack trace. Thank you, Teodor 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