Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319615

Summary: Tooltip error when the series dataset is modified
Product: z_Archived Reporter: Richard Gong <gongcon>
Component: BIRTAssignee: Xingsheng Zhu <xzhu>
Status: RESOLVED FIXED QA Contact: Xiaoying Gu <bluesoldier>
Severity: normal    
Priority: P3 CC: bluesoldier
Version: 2.5.2   
Target Milestone: 2.6.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Add data to chart none

Description Richard Gong CLA 2010-07-12 13:20:17 EDT
I have a need to insert null values to the chart's dataset indicating missing values in order to remove the connection of data points. After that if I put anything in the tooltip text of the chart, e.g., a string "hello", it throws Out of bounds exception as the following Stack Trace. Attached is a bar chart report to reproduce this error.


org.eclipse.birt.report.engine.api.EngineException: org.eclipse.birt.chart.exception.ChartException: Out of bounds
   at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1215)
   at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.processExtendedContent(LocalizedContentVisitor.java:1037)
   at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.localizeForeign(LocalizedContentVisitor.java:579)
   at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.localize(LocalizedContentVisitor.java:163)
   at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:37)
   at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65)
   at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:90)
   at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:99)
   at org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:249)
   at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:252)
   at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:85)
   at org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1307)
   at org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:158)
   at org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81)
   at org.eclipse.birt.report.service.actionhandler.BirtGetPageActionHandler.__checkDocumentExists(BirtGetPageActionHandler.java:58)
   at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.prepareParameters(AbstractGetPageActionHandler.java:119)
   at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.__execute(AbstractGetPageActionHandler.java:104)
   at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
   at org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(AbstractBaseDocumentProcessor.java:47)
   at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(AbstractBaseComponentProcessor.java:143)
   at org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleGetPage(BirtDocumentProcessor.java:87)
   at sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(AbstractBaseComponentProcessor.java:112)
   at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)
   at sun.reflect.GeneratedMethodAccessor111.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
   at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
   at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
   at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
   at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:265)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
   at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
   at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
   at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
   at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
   at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:59)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
   at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:318)
   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:380)
   at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
   at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
   at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
   at org.mortbay.jetty.Server.handle(Server.java:324)
   at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
   at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:880)
   at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:748)
   at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)
   at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
   at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
   at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
Caused by: org.eclipse.birt.chart.exception.ChartException: org.eclipse.birt.chart.exception.ChartException: Out of bounds
   at org.eclipse.birt.chart.factory.Generator.build(Generator.java:1132)
   at org.eclipse.birt.chart.reportitem.ChartReportItemPresentationBase.buildChart(ChartReportItemPresentationBase.java:951)
   at org.eclipse.birt.chart.reportitem.ChartReportItemPresentationBase.generateRenderObject(ChartReportItemPresentationBase.java:839)
   at org.eclipse.birt.chart.reportitem.ChartReportItemPresentationBase.onRowSets(ChartReportItemPresentationBase.java:801)
   at org.eclipse.birt.chart.reportitem.ChartReportItemPresentationProxy.onRowSets(ChartReportItemPresentationProxy.java:108)
   at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.processExtendedContent(LocalizedContentVisitor.java:1014)
... 60 more
Caused by: java.lang.RuntimeException: org.eclipse.birt.chart.exception.ChartException: Out of bounds
   at org.eclipse.birt.chart.computation.DataSetIterator.next(DataSetIterator.java:461)
   at org.eclipse.birt.chart.computation.UserDataSetHints.next(UserDataSetHints.java:83)
   at org.eclipse.birt.chart.computation.withaxes.PlotWith2DAxes.getSeriesRenderingHints(PlotWith2DAxes.java:2327)
   at org.eclipse.birt.chart.factory.Generator.build(Generator.java:1118)
... 65 more
Caused by: org.eclipse.birt.chart.exception.ChartException: Out of bounds
   at org.eclipse.birt.chart.computation.DataSetIterator.next(DataSetIterator.java:464)
... 68 more
Comment 1 Xiaoying Gu CLA 2010-08-17 05:27:07 EDT
Hi Richard,

Would you please attach the report design for us to reproduce this issue?
Comment 2 Richard Gong CLA 2010-08-17 12:26:49 EDT
Created attachment 176808 [details]
Add data to chart

Per Xiaoying's request
Comment 3 Xingsheng Zhu CLA 2010-11-05 02:38:52 EDT
This is caused by the script. For charts contain tooltips, if we need to modify the series' runtime data set, we should also modify user data set for tooltips accordingly. Or it will cause this exception when setting data on datapointhints from user data set. Following is the script which can work after modified.
function afterDataSetFilled( series, dataSet, icsc )
{
    importPackage( Packages.java.util );    
    importPackage( Packages.org.eclipse.birt.chart.model.type.impl );
        var it = series.getDataSets().values().iterator();
       while(it.hasNext())
       {
           var ds = it.next();
           var list = ds.getValues();
           var narray1 = new ArrayList( );
    
        if( series.getClass() == BarSeriesImpl ){
            //narray1.add(null);
            narray1.add(20);
        }else{
            narray1.add("testbefore");
        }    
    
        var ll =list.length;
                for ( i=0; i<ll; i=i+1)
            {
            narray1.add(list[i]);
                }

        if( series.getClass() == BarSeriesImpl ){
            narray1.add(20);
        }else{
            narray1.add("testafter");
        }    
        ds.setValues(narray1);
       }
    
}

Fix the issue to avoid the exception, but user's script still need to be updated or the tooltips will not match the data points.