Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Round average aggregation on chart
Round average aggregation on chart [message #650169] Sat, 22 January 2011 09:29 Go to next message
Klaus Meisl is currently offline Klaus MeislFriend
Messages: 90
Registered: July 2009
Member
Hi,

is there a possibility to round the y-Series value of a chart to a
certain decimal? I use the AVG function and have 3 series. One series
has 2 decimals, the other 1, the last 3. I want to have 1 decimal for
all. How can i archive that?
Thanks.
Re: Round average aggregation on chart [message #650406 is a reply to message #650169] Mon, 24 January 2011 18:00 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Klaus,

Are these data point labels? If so can you try a beforeDrawDataPoint
label script

function beforeDrawDataPointLabel( dph, label, icsc )
{
tmp = BirtMath.roundUp(label.getCaption().getValue(),1);
label.getCaption().setValue(tmp);
}

Jason

On 1/22/2011 4:29 AM, Klaus Meisl wrote:
> Hi,
>
> is there a possibility to round the y-Series value of a chart to a
> certain decimal? I use the AVG function and have 3 series. One series
> has 2 decimals, the other 1, the last 3. I want to have 1 decimal for
> all. How can i archive that?
> Thanks.
Re: Round average aggregation on chart [message #650590 is a reply to message #650406] Tue, 25 January 2011 16:13 Go to previous messageGo to next message
Klaus Meisl is currently offline Klaus MeislFriend
Messages: 90
Registered: July 2009
Member
Jason,

this causes a "NumberFormatException: For input string: "101,13"".
I tried
tmp = BirtMath.roundUp(parseFloat(label.getCaption().getValue)),1) ;
but this returns me an integer value and no decimal.


Am 24.01.11 19:00, schrieb Jason Weathersby:
> Klaus,
>
> Are these data point labels? If so can you try a beforeDrawDataPoint
> label script
>
> function beforeDrawDataPointLabel( dph, label, icsc )
> {
> tmp = BirtMath.roundUp(label.getCaption().getValue(),1);
> label.getCaption().setValue(tmp);
> }
>
> Jason
>
> On 1/22/2011 4:29 AM, Klaus Meisl wrote:
>> Hi,
>>
>> is there a possibility to round the y-Series value of a chart to a
>> certain decimal? I use the AVG function and have 3 series. One series
>> has 2 decimals, the other 1, the last 3. I want to have 1 decimal for
>> all. How can i archive that?
>> Thanks.
>
Re: Round average aggregation on chart [message #650612 is a reply to message #650590] Tue, 25 January 2011 16:40 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I wonder if it has a problem with the locale. Can you try

importPackage(Packages.java.lang)
var myflt = new Float(label.getCaption().getValue());
tmp = BirtMath.roundUp( myflt, 1 );

Jason

On 1/25/2011 11:13 AM, Klaus Meisl wrote:
> Jason,
>
> this causes a "NumberFormatException: For input string: "101,13"".
> I tried
> tmp = BirtMath.roundUp(parseFloat(label.getCaption().getValue)),1) ;
> but this returns me an integer value and no decimal.
>
>
> Am 24.01.11 19:00, schrieb Jason Weathersby:
>> Klaus,
>>
>> Are these data point labels? If so can you try a beforeDrawDataPoint
>> label script
>>
>> function beforeDrawDataPointLabel( dph, label, icsc )
>> {
>> tmp = BirtMath.roundUp(label.getCaption().getValue(),1);
>> label.getCaption().setValue(tmp);
>> }
>>
>> Jason
>>
>> On 1/22/2011 4:29 AM, Klaus Meisl wrote:
>>> Hi,
>>>
>>> is there a possibility to round the y-Series value of a chart to a
>>> certain decimal? I use the AVG function and have 3 series. One series
>>> has 2 decimals, the other 1, the last 3. I want to have 1 decimal for
>>> all. How can i archive that?
>>> Thanks.
>>
>
Re: Round average aggregation on chart [message #650648 is a reply to message #650612] Tue, 25 January 2011 19:51 Go to previous messageGo to next message
Klaus Meisl is currently offline Klaus MeislFriend
Messages: 90
Registered: July 2009
Member
my code:
function beforeDrawDataPointLabel( dph, label, icsc )
{
importPackage(Packages.java.lang)
var myflt = new Float(label.getCaption().getValue());
tmp = BirtMath.roundUp( myflt, 1 );
label.getCaption().setValue(tmp);
}

the error:

Chart (id = 944):
- Wrapped java.lang.NumberFormatException: For input string: "101,13" at
line 16 of chart script:''
exception.javascript.error ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: Wrapped
java.lang.NumberFormatException: For input string: "101,13" at line 16
of chart script:''
at
org.eclipse.birt.report.engine.executor.ExecutionContext.add Exception(ExecutionContext.java:1195)
at
org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.processExtendedContent(LocalizedContentVisitor.java: 1046)
at
org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.localizeForeign(LocalizedContentVisitor.java:579)
at
org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.localize(LocalizedContentVisitor.java:163)
at
org.eclipse.birt.report.engine.internal.executor.l18n.Locali zedReportItemExecutor.execute(LocalizedReportItemExecutor.ja va:37)
at
org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:65)
at
org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
at
org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
at
org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.resumeLayout(HTMLInlineStackingLM.java:111)
at
org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.layoutNodes(HTMLInlineStackingLM.java:160)
at
org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
at
org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
at
org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
at
org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
at
org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layou tChildren(HTMLTableLM.java:132)
at
org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
at
org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
at
org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
at
org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
at
org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.resumeLayout(HTMLInlineStackingLM.java:111)
at
org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.layoutNodes(HTMLInlineStackingLM.java:160)
at
org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
at
org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
at
org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
at
org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
at
org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layou tChildren(HTMLTableLM.java:132)
at
org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
at
org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
at
org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:90)
at
org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:99)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:180)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:77)
at
org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(ReportEngineService.java:920)
at
org.eclipse.birt.report.service.BirtViewerReportService.runA ndRenderReport(BirtViewerReportService.java:973)
at
org.eclipse.birt.report.service.actionhandler.BirtGetPageAll ActionHandler.__execute(BirtGetPageAllActionHandler.java:131 )
at
org.eclipse.birt.report.service.actionhandler.AbstractBaseAc tionHandler.execute(AbstractBaseActionHandler.java:90)
at
org.eclipse.birt.report.soapengine.processor.AbstractBaseDoc umentProcessor.__executeAction(AbstractBaseDocumentProcessor .java:47)
at
org.eclipse.birt.report.soapengine.processor.AbstractBaseCom ponentProcessor.executeAction(AbstractBaseComponentProcessor .java:143)
at
org.eclipse.birt.report.soapengine.processor.BirtDocumentPro cessor.handleGetPageAll(BirtDocumentProcessor.java:183)
at sun.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.eclipse.birt.report.soapengine.processor.AbstractBaseCom ponentProcessor.process(AbstractBaseComponentProcessor.java: 112)
at
org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingI mpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)
at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCP rovider.java:397)
at
org.apache.axis.providers.java.RPCProvider.processMessage(RP CProvider.java:186)
at
org.apache.axis.providers.java.JavaProvider.invoke(JavaProvi der.java:323)
at
org.apache.axis.strategies.InvocationStrategy.visit(Invocati onStrategy.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(AxisServle t.java:699)
at
org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherSer vlet.doPost(BirtSoapMessageDispatcherServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at
org.apache.axis.transport.http.AxisServletBase.service(AxisS ervletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at
org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherSer vlet.service(BirtSoapMessageDispatcherServlet.java:122)
at
org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.service(ServletManager.java:180)
at
org.eclipse.equinox.http.servlet.internal.ServletRegistratio n.service(ServletRegistration.java:61)
at
org.eclipse.equinox.http.servlet.internal.ProxyServlet.proce ssAlias(ProxyServlet.java:126)
at
org.eclipse.equinox.http.servlet.internal.ProxyServlet.servi ce(ProxyServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at
org.eclipse.equinox.http.jetty.internal.HttpServerManager$In ternalHttpServiceServlet.service(HttpServerManager.java:318)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder .java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl er.java:390)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandl er.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandl er.java:765)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapp er.java:152)
at org.mortbay.jetty.Server.handle(Server.java:322)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnectio n.java:542)
at
org.mortbay.jetty.HttpConnection$RequestHandler.content(Http Connection.java:939)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java: 218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java: 404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEn dPoint.java:409)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThr eadPool.java:582)
Caused by: org.eclipse.birt.chart.exception.ChartException: Wrapped
java.lang.NumberFormatException: For input string: "101,13" at line 16
of chart script:''
at
org.eclipse.birt.chart.script.AbstractScriptHandler.convertE xception(AbstractScriptHandler.java:738)
at
org.eclipse.birt.chart.script.AbstractScriptHandler.callJava ScriptFunction(AbstractScriptHandler.java:374)
at
org.eclipse.birt.chart.script.AbstractScriptHandler.callFunc tion(AbstractScriptHandler.java:558)
at org.eclipse.birt.chart.extension.render.Bar.renderSeries(Bar .java:1365)
at
org.eclipse.birt.chart.render.AxesRenderer.renderPlot(AxesRe nderer.java:2268)
at org.eclipse.birt.chart.render.AxesRenderer.render(AxesRender er.java:399)
at org.eclipse.birt.chart.factory.Generator.render(Generator.ja va:1301)
at
org.eclipse.birt.chart.reportitem.ChartReportItemPresentatio nBase.renderToImageFile(ChartReportItemPresentationBase.java :1010)
at
org.eclipse.birt.chart.reportitem.ChartReportItemPresentatio nBase.generateRenderObject(ChartReportItemPresentationBase.j ava:861)
at
org.eclipse.birt.chart.reportitem.ChartReportItemPresentatio nBase.onRowSets(ChartReportItemPresentationBase.java:819)
at
org.eclipse.birt.chart.reportitem.ChartReportItemPresentatio nProxy.onRowSets(ChartReportItemPresentationProxy.java:108)
at
org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.processExtendedContent(LocalizedContentVisitor.java: 1023)
... 78 more
Caused by: org.mozilla.javascript.WrappedException: Wrapped
java.lang.NumberFormatException: For input string: "101,13"
(/report/body/grid[@id="758"]/row[@id="761"]/cell[@id="763 "]/grid[@id="935"]/row[@id="942"]/cell[@id="943"]/extended-item[@id= "944"]/method[@name="onRender"]#16)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Contex t.java:1773)
at org.mozilla.javascript.MemberBox.newInstance(MemberBox.java: 202)
at
org.mozilla.javascript.NativeJavaClass.constructSpecific(Nat iveJavaClass.java:281)
at
org.mozilla.javascript.NativeJavaClass.construct(NativeJavaC lass.java:200)
at org.mozilla.javascript.ScriptRuntime.newObject(ScriptRuntime .java:2327)
at
org.mozilla.javascript.gen.c354._c1(/report/body/grid[@id="758 "]/row[@id="761"]/cell[@id="763"]/grid[@id="935"]/row[@id= "942"]/cell[@id="943"]/extended-item[@id="944"]/method[@name= "onRender"]:16)
at
org.mozilla.javascript.gen.c354.call(/report/body/grid[@id="758 "]/row[@id="761"]/cell[@id="763"]/grid[@id="935"]/row[@id= "942"]/cell[@id="943"]/extended-item[@id="944"]/method[@name= "onRender"])
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:398)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:3065)
at
org.mozilla.javascript.gen.c354.call(/report/body/grid[@id="758 "]/row[@id="761"]/cell[@id="763"]/grid[@id="935"]/row[@id= "942"]/cell[@id="943"]/extended-item[@id="944"]/method[@name= "onRender"])
at
org.eclipse.birt.chart.script.AbstractScriptHandler.callJava ScriptFunction(AbstractScriptHandler.java:370)
... 88 more
Caused by: java.lang.NumberFormatException: For input string: "101,13"
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecima l.java:1224)
at java.lang.Float.valueOf(Float.java:388)
at java.lang.Float.<init>(Float.java:489)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:5 13)
at org.mozilla.javascript.MemberBox.newInstance(MemberBox.java: 194)
... 97 more


Am 25.01.11 17:40, schrieb Jason Weathersby:
> I wonder if it has a problem with the locale. Can you try
>
> importPackage(Packages.java.lang)
> var myflt = new Float(label.getCaption().getValue());
> tmp = BirtMath.roundUp( myflt, 1 );
>
> Jason
>
> On 1/25/2011 11:13 AM, Klaus Meisl wrote:
>> Jason,
>>
>> this causes a "NumberFormatException: For input string: "101,13"".
>> I tried
>> tmp = BirtMath.roundUp(parseFloat(label.getCaption().getValue)),1) ;
>> but this returns me an integer value and no decimal.
>>
>>
>> Am 24.01.11 19:00, schrieb Jason Weathersby:
>>> Klaus,
>>>
>>> Are these data point labels? If so can you try a beforeDrawDataPoint
>>> label script
>>>
>>> function beforeDrawDataPointLabel( dph, label, icsc )
>>> {
>>> tmp = BirtMath.roundUp(label.getCaption().getValue(),1);
>>> label.getCaption().setValue(tmp);
>>> }
>>>
>>> Jason
>>>
>>> On 1/22/2011 4:29 AM, Klaus Meisl wrote:
>>>> Hi,
>>>>
>>>> is there a possibility to round the y-Series value of a chart to a
>>>> certain decimal? I use the AVG function and have 3 series. One series
>>>> has 2 decimals, the other 1, the last 3. I want to have 1 decimal for
>>>> all. How can i archive that?
>>>> Thanks.
>>>
>>
>
Re: Round average aggregation on chart [message #650819 is a reply to message #650648] Wed, 26 January 2011 17:00 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

This seems a bit like over kill but try:

importPackage(Packages.java.text);
importPackage(Packages.java.util);
nf = NumberFormat.getInstance(Locale.GERMAN);
var myflt = nf.parse(label.getCaption().getValue());
tmp = BirtMath.roundUp( myflt, 1 );
label.getCaption().setValue(tmp);

Change the locale to your locale.

Jason

On 1/25/2011 2:51 PM, Klaus Meisl wrote:
> my code:
> function beforeDrawDataPointLabel( dph, label, icsc )
> {
> importPackage(Packages.java.lang)
> var myflt = new Float(label.getCaption().getValue());
> tmp = BirtMath.roundUp( myflt, 1 );
> label.getCaption().setValue(tmp);
> }
>
> the error:
>
> Chart (id = 944):
> - Wrapped java.lang.NumberFormatException: For input string: "101,13" at
> line 16 of chart script:''
> exception.javascript.error ( 1 time(s) )
> detail : org.eclipse.birt.report.engine.api.EngineException: Wrapped
> java.lang.NumberFormatException: For input string: "101,13" at line 16
> of chart script:''
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.add Exception(ExecutionContext.java:1195)
> at
> org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.processExtendedContent(LocalizedContentVisitor.java: 1046)
> at
> org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.localizeForeign(LocalizedContentVisitor.java:579)
> at
> org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.localize(LocalizedContentVisitor.java:163)
> at
> org.eclipse.birt.report.engine.internal.executor.l18n.Locali zedReportItemExecutor.execute(LocalizedReportItemExecutor.ja va:37)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:65)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.resumeLayout(HTMLInlineStackingLM.java:111)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.layoutNodes(HTMLInlineStackingLM.java:160)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layou tChildren(HTMLTableLM.java:132)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.resumeLayout(HTMLInlineStackingLM.java:111)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.layoutNodes(HTMLInlineStackingLM.java:160)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layou tChildren(HTMLTableLM.java:132)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:90)
> at
> org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:99)
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:180)
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:77)
> at
> org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(ReportEngineService.java:920)
> at
> org.eclipse.birt.report.service.BirtViewerReportService.runA ndRenderReport(BirtViewerReportService.java:973)
> at
> org.eclipse.birt.report.service.actionhandler.BirtGetPageAll ActionHandler.__execute(BirtGetPageAllActionHandler.java:131 )
> at
> org.eclipse.birt.report.service.actionhandler.AbstractBaseAc tionHandler.execute(AbstractBaseActionHandler.java:90)
> at
> org.eclipse.birt.report.soapengine.processor.AbstractBaseDoc umentProcessor.__executeAction(AbstractBaseDocumentProcessor .java:47)
> at
> org.eclipse.birt.report.soapengine.processor.AbstractBaseCom ponentProcessor.executeAction(AbstractBaseComponentProcessor .java:143)
> at
> org.eclipse.birt.report.soapengine.processor.BirtDocumentPro cessor.handleGetPageAll(BirtDocumentProcessor.java:183)
> at sun.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.eclipse.birt.report.soapengine.processor.AbstractBaseCom ponentProcessor.process(AbstractBaseComponentProcessor.java: 112)
> at
> org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingI mpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)
> at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCP rovider.java:397)
> at
> org.apache.axis.providers.java.RPCProvider.processMessage(RP CProvider.java:186)
> at
> org.apache.axis.providers.java.JavaProvider.invoke(JavaProvi der.java:323)
> at
> org.apache.axis.strategies.InvocationStrategy.visit(Invocati onStrategy.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(AxisServle t.java:699)
> at
> org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherSer vlet.doPost(BirtSoapMessageDispatcherServlet.java:265)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> at
> org.apache.axis.transport.http.AxisServletBase.service(AxisS ervletBase.java:327)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at
> org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherSer vlet.service(BirtSoapMessageDispatcherServlet.java:122)
> at
> org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.service(ServletManager.java:180)
> at
> org.eclipse.equinox.http.servlet.internal.ServletRegistratio n.service(ServletRegistration.java:61)
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.proce ssAlias(ProxyServlet.java:126)
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.servi ce(ProxyServlet.java:60)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at
> org.eclipse.equinox.http.jetty.internal.HttpServerManager$In ternalHttpServiceServlet.service(HttpServerManager.java:318)
> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder .java:511)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl er.java:390)
> at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandl er.java:182)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandl er.java:765)
> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapp er.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:322)
> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnectio n.java:542)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(Http Connection.java:939)
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java: 218)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java: 404)
> at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEn dPoint.java:409)
> at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThr eadPool.java:582)
> Caused by: org.eclipse.birt.chart.exception.ChartException: Wrapped
> java.lang.NumberFormatException: For input string: "101,13" at line 16
> of chart script:''
> at
> org.eclipse.birt.chart.script.AbstractScriptHandler.convertE xception(AbstractScriptHandler.java:738)
> at
> org.eclipse.birt.chart.script.AbstractScriptHandler.callJava ScriptFunction(AbstractScriptHandler.java:374)
> at
> org.eclipse.birt.chart.script.AbstractScriptHandler.callFunc tion(AbstractScriptHandler.java:558)
> at org.eclipse.birt.chart.extension.render.Bar.renderSeries(Bar .java:1365)
> at
> org.eclipse.birt.chart.render.AxesRenderer.renderPlot(AxesRe nderer.java:2268)
> at org.eclipse.birt.chart.render.AxesRenderer.render(AxesRender er.java:399)
> at org.eclipse.birt.chart.factory.Generator.render(Generator.ja va:1301)
> at
> org.eclipse.birt.chart.reportitem.ChartReportItemPresentatio nBase.renderToImageFile(ChartReportItemPresentationBase.java :1010)
> at
> org.eclipse.birt.chart.reportitem.ChartReportItemPresentatio nBase.generateRenderObject(ChartReportItemPresentationBase.j ava:861)
> at
> org.eclipse.birt.chart.reportitem.ChartReportItemPresentatio nBase.onRowSets(ChartReportItemPresentationBase.java:819)
> at
> org.eclipse.birt.chart.reportitem.ChartReportItemPresentatio nProxy.onRowSets(ChartReportItemPresentationProxy.java:108)
> at
> org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.processExtendedContent(LocalizedContentVisitor.java: 1023)
> ... 78 more
> Caused by: org.mozilla.javascript.WrappedException: Wrapped
> java.lang.NumberFormatException: For input string: "101,13"
> (/report/body/grid[@id="758"]/row[@id="761"]/cell[@id="763 "]/grid[@id="935"]/row[@id="942"]/cell[@id="943"]/extended-item[@id= "944"]/method[@name="onRender"]#16)
> at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Contex t.java:1773)
> at org.mozilla.javascript.MemberBox.newInstance(MemberBox.java: 202)
> at
> org.mozilla.javascript.NativeJavaClass.constructSpecific(Nat iveJavaClass.java:281)
> at
> org.mozilla.javascript.NativeJavaClass.construct(NativeJavaC lass.java:200)
> at org.mozilla.javascript.ScriptRuntime.newObject(ScriptRuntime .java:2327)
> at
> org.mozilla.javascript.gen.c354._c1(/report/body/grid[@id="758 "]/row[@id="761"]/cell[@id="763"]/grid[@id="935"]/row[@id= "942"]/cell[@id="943"]/extended-item[@id="944"]/method[@name= "onRender"]:16)
> at
> org.mozilla.javascript.gen.c354.call(/report/body/grid[@id="758 "]/row[@id="761"]/cell[@id="763"]/grid[@id="935"]/row[@id= "942"]/cell[@id="943"]/extended-item[@id="944"]/method[@name= "onRender"])
> at org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:398)
> at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:3065)
> at
> org.mozilla.javascript.gen.c354.call(/report/body/grid[@id="758 "]/row[@id="761"]/cell[@id="763"]/grid[@id="935"]/row[@id= "942"]/cell[@id="943"]/extended-item[@id="944"]/method[@name= "onRender"])
> at
> org.eclipse.birt.chart.script.AbstractScriptHandler.callJava ScriptFunction(AbstractScriptHandler.java:370)
> ... 88 more
> Caused by: java.lang.NumberFormatException: For input string: "101,13"
> at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecima l.java:1224)
> at java.lang.Float.valueOf(Float.java:388)
> at java.lang.Float.<init>(Float.java:489)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:5 13)
> at org.mozilla.javascript.MemberBox.newInstance(MemberBox.java: 194)
> ... 97 more
>
>
> Am 25.01.11 17:40, schrieb Jason Weathersby:
>> I wonder if it has a problem with the locale. Can you try
>>
>> importPackage(Packages.java.lang)
>> var myflt = new Float(label.getCaption().getValue());
>> tmp = BirtMath.roundUp( myflt, 1 );
>>
>> Jason
>>
>> On 1/25/2011 11:13 AM, Klaus Meisl wrote:
>>> Jason,
>>>
>>> this causes a "NumberFormatException: For input string: "101,13"".
>>> I tried
>>> tmp = BirtMath.roundUp(parseFloat(label.getCaption().getValue)),1) ;
>>> but this returns me an integer value and no decimal.
>>>
>>>
>>> Am 24.01.11 19:00, schrieb Jason Weathersby:
>>>> Klaus,
>>>>
>>>> Are these data point labels? If so can you try a beforeDrawDataPoint
>>>> label script
>>>>
>>>> function beforeDrawDataPointLabel( dph, label, icsc )
>>>> {
>>>> tmp = BirtMath.roundUp(label.getCaption().getValue(),1);
>>>> label.getCaption().setValue(tmp);
>>>> }
>>>>
>>>> Jason
>>>>
>>>> On 1/22/2011 4:29 AM, Klaus Meisl wrote:
>>>>> Hi,
>>>>>
>>>>> is there a possibility to round the y-Series value of a chart to a
>>>>> certain decimal? I use the AVG function and have 3 series. One series
>>>>> has 2 decimals, the other 1, the last 3. I want to have 1 decimal for
>>>>> all. How can i archive that?
>>>>> Thanks.
>>>>
>>>
>>
>
Re: Round average aggregation on chart [message #650820 is a reply to message #650819] Wed, 26 January 2011 17:11 Go to previous message
Klaus Meisl is currently offline Klaus MeislFriend
Messages: 90
Registered: July 2009
Member
this works... thx


Am 26.01.11 18:00, schrieb Jason Weathersby:
> This seems a bit like over kill but try:
>
> importPackage(Packages.java.text);
> importPackage(Packages.java.util);
> nf = NumberFormat.getInstance(Locale.GERMAN);
> var myflt = nf.parse(label.getCaption().getValue());
> tmp = BirtMath.roundUp( myflt, 1 );
> label.getCaption().setValue(tmp);
>
> Change the locale to your locale.
>
> Jason
>
> On 1/25/2011 2:51 PM, Klaus Meisl wrote:
>> my code:
>> function beforeDrawDataPointLabel( dph, label, icsc )
>> {
>> importPackage(Packages.java.lang)
>> var myflt = new Float(label.getCaption().getValue());
>> tmp = BirtMath.roundUp( myflt, 1 );
>> label.getCaption().setValue(tmp);
>> }
>>
>> the error:
>>
>> Chart (id = 944):
>> - Wrapped java.lang.NumberFormatException: For input string: "101,13" at
>> line 16 of chart script:''
>> exception.javascript.error ( 1 time(s) )
>> detail : org.eclipse.birt.report.engine.api.EngineException: Wrapped
>> java.lang.NumberFormatException: For input string: "101,13" at line 16
>> of chart script:''
>> at
>> org.eclipse.birt.report.engine.executor.ExecutionContext.add Exception(ExecutionContext.java:1195)
>>
>> at
>> org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.processExtendedContent(LocalizedContentVisitor.java: 1046)
>>
>> at
>> org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.localizeForeign(LocalizedContentVisitor.java:579)
>>
>> at
>> org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.localize(LocalizedContentVisitor.java:163)
>>
>> at
>> org.eclipse.birt.report.engine.internal.executor.l18n.Locali zedReportItemExecutor.execute(LocalizedReportItemExecutor.ja va:37)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:65)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.resumeLayout(HTMLInlineStackingLM.java:111)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.layoutNodes(HTMLInlineStackingLM.java:160)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layou tChildren(HTMLTableLM.java:132)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.resumeLayout(HTMLInlineStackingLM.java:111)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLInlineStackin gLM.layoutNodes(HTMLInlineStackingLM.java:160)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.la youtChildren(HTMLStackingLM.java:26)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layou tChildren(HTMLTableLM.java:132)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.la yout(HTMLAbstractLM.java:140)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:70)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:90)
>>
>> at
>> org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:99)
>>
>> at
>> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:180)
>>
>> at
>> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:77)
>>
>> at
>> org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(ReportEngineService.java:920)
>>
>> at
>> org.eclipse.birt.report.service.BirtViewerReportService.runA ndRenderReport(BirtViewerReportService.java:973)
>>
>> at
>> org.eclipse.birt.report.service.actionhandler.BirtGetPageAll ActionHandler.__execute(BirtGetPageAllActionHandler.java:131 )
>>
>> at
>> org.eclipse.birt.report.service.actionhandler.AbstractBaseAc tionHandler.execute(AbstractBaseActionHandler.java:90)
>>
>> at
>> org.eclipse.birt.report.soapengine.processor.AbstractBaseDoc umentProcessor.__executeAction(AbstractBaseDocumentProcessor .java:47)
>>
>> at
>> org.eclipse.birt.report.soapengine.processor.AbstractBaseCom ponentProcessor.executeAction(AbstractBaseComponentProcessor .java:143)
>>
>> at
>> org.eclipse.birt.report.soapengine.processor.BirtDocumentPro cessor.handleGetPageAll(BirtDocumentProcessor.java:183)
>>
>> at sun.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> org.eclipse.birt.report.soapengine.processor.AbstractBaseCom ponentProcessor.process(AbstractBaseComponentProcessor.java: 112)
>>
>> at
>> org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingI mpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)
>>
>> at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at
>> org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCP rovider.java:397)
>>
>> at
>> org.apache.axis.providers.java.RPCProvider.processMessage(RP CProvider.java:186)
>>
>> at
>> org.apache.axis.providers.java.JavaProvider.invoke(JavaProvi der.java:323)
>> at
>> org.apache.axis.strategies.InvocationStrategy.visit(Invocati onStrategy.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(AxisServle t.java:699)
>> at
>> org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherSer vlet.doPost(BirtSoapMessageDispatcherServlet.java:265)
>>
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
>> at
>> org.apache.axis.transport.http.AxisServletBase.service(AxisS ervletBase.java:327)
>>
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>> at
>> org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherSer vlet.service(BirtSoapMessageDispatcherServlet.java:122)
>>
>> at
>> org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.service(ServletManager.java:180)
>>
>> at
>> org.eclipse.equinox.http.servlet.internal.ServletRegistratio n.service(ServletRegistration.java:61)
>>
>> at
>> org.eclipse.equinox.http.servlet.internal.ProxyServlet.proce ssAlias(ProxyServlet.java:126)
>>
>> at
>> org.eclipse.equinox.http.servlet.internal.ProxyServlet.servi ce(ProxyServlet.java:60)
>>
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>> at
>> org.eclipse.equinox.http.jetty.internal.HttpServerManager$In ternalHttpServiceServlet.service(HttpServerManager.java:318)
>>
>> at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder .java:511)
>> at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl er.java:390)
>> at
>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandl er.java:182)
>> at
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandl er.java:765)
>> at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapp er.java:152)
>> at org.mortbay.jetty.Server.handle(Server.java:322)
>> at
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnectio n.java:542)
>> at
>> org.mortbay.jetty.HttpConnection$RequestHandler.content(Http Connection.java:939)
>>
>> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
>> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java: 218)
>> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java: 404)
>> at
>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEn dPoint.java:409)
>>
>> at
>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThr eadPool.java:582)
>>
>> Caused by: org.eclipse.birt.chart.exception.ChartException: Wrapped
>> java.lang.NumberFormatException: For input string: "101,13" at line 16
>> of chart script:''
>> at
>> org.eclipse.birt.chart.script.AbstractScriptHandler.convertE xception(AbstractScriptHandler.java:738)
>>
>> at
>> org.eclipse.birt.chart.script.AbstractScriptHandler.callJava ScriptFunction(AbstractScriptHandler.java:374)
>>
>> at
>> org.eclipse.birt.chart.script.AbstractScriptHandler.callFunc tion(AbstractScriptHandler.java:558)
>>
>> at
>> org.eclipse.birt.chart.extension.render.Bar.renderSeries(Bar .java:1365)
>> at
>> org.eclipse.birt.chart.render.AxesRenderer.renderPlot(AxesRe nderer.java:2268)
>>
>> at
>> org.eclipse.birt.chart.render.AxesRenderer.render(AxesRender er.java:399)
>> at
>> org.eclipse.birt.chart.factory.Generator.render(Generator.ja va:1301)
>> at
>> org.eclipse.birt.chart.reportitem.ChartReportItemPresentatio nBase.renderToImageFile(ChartReportItemPresentationBase.java :1010)
>>
>> at
>> org.eclipse.birt.chart.reportitem.ChartReportItemPresentatio nBase.generateRenderObject(ChartReportItemPresentationBase.j ava:861)
>>
>> at
>> org.eclipse.birt.chart.reportitem.ChartReportItemPresentatio nBase.onRowSets(ChartReportItemPresentationBase.java:819)
>>
>> at
>> org.eclipse.birt.chart.reportitem.ChartReportItemPresentatio nProxy.onRowSets(ChartReportItemPresentationProxy.java:108)
>>
>> at
>> org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.processExtendedContent(LocalizedContentVisitor.java: 1023)
>>
>> ... 78 more
>> Caused by: org.mozilla.javascript.WrappedException: Wrapped
>> java.lang.NumberFormatException: For input string: "101,13"
>> (/report/body/grid[@id="758"]/row[@id="761"]/cell[@id="763 "]/grid[@id="935"]/row[@id="942"]/cell[@id="943"]/extended-item[@id= "944"]/method[@name="onRender"]#16)
>>
>> at
>> org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Contex t.java:1773)
>> at org.mozilla.javascript.MemberBox.newInstance(MemberBox.java: 202)
>> at
>> org.mozilla.javascript.NativeJavaClass.constructSpecific(Nat iveJavaClass.java:281)
>>
>> at
>> org.mozilla.javascript.NativeJavaClass.construct(NativeJavaC lass.java:200)
>>
>> at
>> org.mozilla.javascript.ScriptRuntime.newObject(ScriptRuntime .java:2327)
>> at
>> org.mozilla.javascript.gen.c354._c1(/report/body/grid[@id="758 "]/row[@id="761"]/cell[@id="763"]/grid[@id="935"]/row[@id= "942"]/cell[@id="943"]/extended-item[@id="944"]/method[@name= "onRender"]:16)
>>
>> at
>> org.mozilla.javascript.gen.c354.call(/report/body/grid[@id="758 "]/row[@id="761"]/cell[@id="763"]/grid[@id="935"]/row[@id= "942"]/cell[@id="943"]/extended-item[@id="944"]/method[@name= "onRender"])
>>
>> at
>> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:398)
>> at
>> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:3065)
>> at
>> org.mozilla.javascript.gen.c354.call(/report/body/grid[@id="758 "]/row[@id="761"]/cell[@id="763"]/grid[@id="935"]/row[@id= "942"]/cell[@id="943"]/extended-item[@id="944"]/method[@name= "onRender"])
>>
>> at
>> org.eclipse.birt.chart.script.AbstractScriptHandler.callJava ScriptFunction(AbstractScriptHandler.java:370)
>>
>> ... 88 more
>> Caused by: java.lang.NumberFormatException: For input string: "101,13"
>> at
>> sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecima l.java:1224)
>> at java.lang.Float.valueOf(Float.java:388)
>> at java.lang.Float.<init>(Float.java:489)
>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e
>> Method)
>> at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
>>
>> at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
>>
>> at java.lang.reflect.Constructor.newInstance(Constructor.java:5 13)
>> at org.mozilla.javascript.MemberBox.newInstance(MemberBox.java: 194)
>> ... 97 more
>>
>>
>> Am 25.01.11 17:40, schrieb Jason Weathersby:
>>> I wonder if it has a problem with the locale. Can you try
>>>
>>> importPackage(Packages.java.lang)
>>> var myflt = new Float(label.getCaption().getValue());
>>> tmp = BirtMath.roundUp( myflt, 1 );
>>>
>>> Jason
>>>
>>> On 1/25/2011 11:13 AM, Klaus Meisl wrote:
>>>> Jason,
>>>>
>>>> this causes a "NumberFormatException: For input string: "101,13"".
>>>> I tried
>>>> tmp = BirtMath.roundUp(parseFloat(label.getCaption().getValue)),1) ;
>>>> but this returns me an integer value and no decimal.
>>>>
>>>>
>>>> Am 24.01.11 19:00, schrieb Jason Weathersby:
>>>>> Klaus,
>>>>>
>>>>> Are these data point labels? If so can you try a beforeDrawDataPoint
>>>>> label script
>>>>>
>>>>> function beforeDrawDataPointLabel( dph, label, icsc )
>>>>> {
>>>>> tmp = BirtMath.roundUp(label.getCaption().getValue(),1);
>>>>> label.getCaption().setValue(tmp);
>>>>> }
>>>>>
>>>>> Jason
>>>>>
>>>>> On 1/22/2011 4:29 AM, Klaus Meisl wrote:
>>>>>> Hi,
>>>>>>
>>>>>> is there a possibility to round the y-Series value of a chart to a
>>>>>> certain decimal? I use the AVG function and have 3 series. One series
>>>>>> has 2 decimals, the other 1, the last 3. I want to have 1 decimal for
>>>>>> all. How can i archive that?
>>>>>> Thanks.
>>>>>
>>>>
>>>
>>
>
Previous Topic:SQL Text and Birt formating
Next Topic:Word: Diplay property Inline
Goto Forum:
  


Current Time: Mon Dec 22 14:18:30 GMT 2014

Powered by FUDForum. Page generated in 0.08893 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software