Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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

share|improve this question
Are you calculating the variables within the report? Or from outside the report in Java? – Tom Jun 7 at 16:47
I am calculating variables inside report. – Priya Pratheep Jun 10 at 1:25

2 Answers

@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) ) ) ) ) )

share|improve this answer

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

Cheers, Thomas http://www.thomaszimmer.net

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.