Jump to content
We've recently updated our Privacy Statement, available here ×

Piechart can anyone verify this?


2005 IR Help

Recommended Posts

By: GBH - ghenrikb

Piechart can anyone verify this?

2005-09-01 02:29

I'm tring to et a simple piechart work in the new version with no luck the way I want it...

 

Select * where ClientAccount = 1 and Date = "2005-09-01"

 

From this I choose

 

Fields

 

ClientAccount Integer

MetalCode String

MetalValue Double

 

 

These are going in a piechart to show the respetive share of metalvalue against total value of the

client account. The label of each piece in the chart is the MetalCode.

 

What I try to do is this.

 

I make one report series to the MetalValue and one to the label eg MetalCode.

These definitions look like this

 

 

Name = SERIE_MetalValue

Variable classtype = Double

Calculation Type = SUM

 

Variable Expression

((it.businesslogic.ireport.IReportScriptlet)$P{REPORT_SCRIPTLET}).addValueToSerie($V{SERIE_MetalValue},$F{MetalValue})

 

Name = SERIE_MetalCode

Variable classtype = String

Calculation Type = Nothing

 

Variable Expression

$F{MetalCode}

 

 

These two go into the piechart in the following way.

Under the chartproperties/chartdata/details

I put this.

 

Key expression

$F{AccountId}

 

Valueexpression

$V{SERIE_MetalValue}

 

Labelexpression

$V{SERIE_MetalCode}

 

Now done!

 

I try and run it

 

Compiling to file... .graftest.jasper -> C:Program FilesiReport-0.5.1graftest.java Errors compiling .graftest.jasper! it.businesslogic.ireport.ReportClassLoader@1b7aa8

net.sf.jasperreports.engine.JRException:?Errors?were?encountered?when?compiling?report?expressions?class?file:

1.?Cannot?cast?from?Boolean?to?Double ????????????????

value?=?(java.lang.Double)(((it.businesslogic.ireport.IReportScriptlet)((graftestScriptlet)parameter_REPORT_SCRIPTLET.getValue())).addValueToSerie(((java.lang.Double)variable_SERIE_MetalValue.getValue()),((java.lang.Double)field_MetalValue.getValue()))); ????????????????????????

<---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

2.?The?method?addValueToSerie(String,?Object)?in?the?type?IReportScriptlet?is?not?applicable?for?the?arguments?(Double,?Double) ????????????????

value?=?(java.lang.Double)(((it.businesslogic.ireport.IReportScriptlet)((graftestScriptlet)parameter_REPORT_SCRIPTLET.getValue())).addValueToSerie(((java.lang.Double)variable_SERIE_MetalValue.getValue()),((java.lang.Double)field_MetalValue.getValue()))); ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

<------------->

3.?Cannot?cast?from?Boolean?to?Double ????????????????value?=?(java.lang.Double)(((it.businesslogic.ireport.IReportScriptlet)((graftestScriptlet)parameter_REPORT_SCRIPTLET.getValue())).addValueToSerie(((java.lang.Double)variable_SERIE_MetalValue.getOldValue()),((java.lang.Double)field_MetalValue.getOldValue()))); ????????????????????????

<---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

4.?The?method?addValueToSerie(String,?Object)?in?the?type?IReportScriptlet?is?not?applicable?for?the?arguments?(Double,?Double) ????????????????value?=?(java.lang.Double)(((it.businesslogic.ireport.IReportScriptlet)((graftestScriptlet)parameter_REPORT_SCRIPTLET.getValue())).addValueToSerie(((java.lang.Double)variable_SERIE_MetalValue.getOldValue()),((java.lang.Double)field_MetalValue.getOldValue()))); ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????<------------->

5.?Cannot?cast?from?Boolean?to?Double ????????????????value?=?(java.lang.Double)(((it.businesslogic.ireport.IReportScriptlet)((graftestScriptlet)parameter_REPORT_SCRIPTLET.getValue())).addValueToSerie(((java.lang.Double)variable_SERIE_MetalValue.getEstimatedValue()),((java.lang.Double)field_MetalValue.getValue()))); ????????????????????????<-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 6.?The?method?addValueToSerie(String,?Object)?in?the?type?IReportScriptlet?is?not?applicable?for?the?arguments?(Double,?Double) ????????????????value?=?(java.lang.Double)(((it.businesslogic.ireport.IReportScriptlet)((graftestScriptlet)parameter_REPORT_SCRIPTLET.getValue())).addValueToSerie(((java.lang.Double)variable_SERIE_MetalValue.getEstimatedValue()),((java.lang.Double)field_MetalValue.getValue()))); ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????<-------------> 6?errors ????at?net.sf.jasperreports.engine.design.JRJdtCompiler.compileReport(JRJdtCompiler.java:178) ????at?net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:129) ????at?net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:127) ????at?net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:109) ????at?it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:461) ????at?java.lang.Thread.run(Unknown?Source) Compilation running time : 531

 

I cant figue out where I get i wrong.....

Could anyone give me a tip? I really sont get why I get a cast error when the field is a double...

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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