Priya Pratheep
Priya Pratheep

Reputation: 43

Create pie chart with variables from report

I want to create a pie chart with calculated variables from report jrxml file. I created bar char successfully with

series expression: "1.Budget Sales
Category expression: new Integer(1)
Value expression: $V{ptd_budget_sales}

like that I added four series for four bars.

I need to use same way to create pie char. but in pie chart have only one section value

key expression
value expression
label expression

cant give more than one.

I usually pass pie char value from Java data source but now i need to take values from calculated variables only. I Google but found similar questions without answer. Please anybody help me or any link...

I read somewhere that can create from csv file too. In that case how to create a csv file from report? I know to create from Java but not from report ...any suggestion is appreciated..

Upvotes: 0

Views: 2025

Answers (2)

Thomas Zimmer
Thomas Zimmer

Reputation: 189

There is no need to create a csv. pls. post your report, that will make a concrete answer easier. Do you use different variables to show in the chart? At which time are the variables ready? Maybe using a group in the report or setting the increment type could be a clue...

Upvotes: 1

Priya Pratheep
Priya Pratheep

Reputation: 43

@Thomas Zimmer thanks for reply

I done this with if condition of Value expression

(java.lang.Integer.parseInt($F{Value}.toString()) == 1 ? new java.lang.Double($V{ptd_labour_othPur_cost}.doubleValue()) : (java.lang.Integer.parseInt($F{Value}.toString()) == 2 ? $V{ctc_labour_othPur_cost} : (java.lang.Integer.parseInt($F{Value}.toString()) == 3 ? new java.lang.Double($V{ptd_ico_subcon_cost}.doubleValue()) : (java.lang.Integer.parseInt($F{Value}.toString()) == 4 ? $V{ctc_ico_subcon_cost} : (java.lang.Integer.parseInt($F{Value}.toString()) == 5 ? $V{predict_profit} : new java.lang.Double(6) ) ) ) ) )

Upvotes: 1

Related Questions