Jump to content
Changes to the Jaspersoft community edition download ×

Basic help creating chart on V0.5.1.


2002 JI Open Discussion

Recommended Posts

By: hugo de la mora - hugodelamora

Basic help creating chart on V0.5.1.

2005-09-06 10:29

Hi, i created a lot of charts using v0.5.0. now with this new version, i don't find where to create the report series, can anybody help me ...where is the correct way to set up the chart data on the chart properties window in v 0.5.1? thx

 

 

By: hugo de la mora - hugodelamora

RE: Basic help creating chart on V0.5.1.

2005-09-06 10:36

....i was trying to create a pie chart, with a bar chart it is the same that v0.5.0.

 

 

By: nidhi - nidhi_vaid

RE: Basic help creating chart on V0.5.1.

2005-09-07 01:20

Hi

 

I am facing the same problem not getting the right track to

use the chart tool and set up the chart data.

 

 

 

 

 

By: GBH - ghenrikb

RE: Basic help creating chart on V0.5.1.

2005-09-19 06:10

I have tried to do the exact the same thing. The series I have created as a variable. I'm not sure im on the right way but take a look at this and You might get a clue if U move forward please let me know.

 

SQL

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 = None

 

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

 

 

 

 

By: GBH - ghenrikb

RE: Basic help creating chart on V0.5.1.

2005-09-20 02:39

hugodelamora, nidhi_vaid I just solved it with charts. What do You want to do?

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