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

I usually create chart with Passing map object from Java code and in iReport using sub data set I create the chart.

Now I need to create a bar chart from calculated values of other fields of same report. For example one of the text box calculated value is

new java.lang.Double((Double.valueOf( $P{REPORT_PARAMETERS_MAP}.get("budget_labour_cost").toString()).doubleValue()) 
            + (Double.valueOf( $P{REPORT_PARAMETERS_MAP}.get("budget_ico_cost").toString()).doubleValue()) 
            + (Double.valueOf( $P{REPORT_PARAMETERS_MAP}.get("budget_subcon_cost").toString()).doubleValue()) 
            + (Double.valueOf( $P{REPORT_PARAMETERS_MAP}.get("budget_oth_purchase_cost").toString()).doubleValue()) 
        )

I need to use the result of the expression in one bar of bar chart.

share|improve this question

1 Answer

up vote 0 down vote accepted

You can still use a dataset; simply collect the results of the text fields in a variable (type list or map), then create a new datasource from this for your dataset.

The variable might use an expression similar to

$V{variable}.add() ? $V{variable} : $V{variable}

Calculation type "Nothing".

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.