s9202 Posted July 10, 2013 Share Posted July 10, 2013 I have made table with one column of numbers and another of percent values.Percent values are made by textFields with expresions like this: <textFieldExpression><![CDATA[new Double( ($F{number}.doubleValue() / $V{totalNumber}.doubleValue())*100 )]]></textFieldExpression>In column footers i want to have totals. For number is ok, but i have no idea how to make it for percent values, because they are only a textFields.Number || Percent4 || 40%3 || 30%3 || 30%==Totals===10 || 100% <-- problem Link to comment Share on other sites More sharing options...
ravenheart Posted July 11, 2013 Share Posted July 11, 2013 Why not store or create the % values as decimals? 0.3, 0.4 etc.? Then they'd sum correctly, and all you'd need to do in the report is set the display pattern to be a percentage. Link to comment Share on other sites More sharing options...
s9202 Posted July 11, 2013 Author Share Posted July 11, 2013 As you see this value is Double (look in my expression). My problem is that I know how to sum Fields from datasource like my "Number" column, but I don't know how to sum simple textFields which counts % values for me in "Percent" column. Link to comment Share on other sites More sharing options...
ravenheart Posted July 11, 2013 Share Posted July 11, 2013 So you're percentages aren't stored in a field in the data source? You're creating them in the report for each value from the number field? Link to comment Share on other sites More sharing options...
s9202 Posted July 12, 2013 Author Share Posted July 12, 2013 Yes, that's right. I get "Number" from datasource and then my report counts % in Percent column. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now