BatiB80 Posted November 26, 2007 Share Posted November 26, 2007 Hi, I've a question which ahs been discussed here several times, but it seems that all the solutions are'nt working for me. Following problem: In my detail-band I show a field named $F{customerCount}. In the summary section I sum up this field and show the sum: $V{sumCustomerCount}. That is working fine. But additionally to the customerCount I want to show the percentage value of this customerCount from sum of customerCount. Therefor I added a new variable: new BigDecimal($F{customerCount}.doubleValue() / $V{sumCustomerCount}.doubleValue()) But this isn't working somehow. It seems, that the value for the sum isn't calculated yet. Does anybody knows what to do??? Thanks,Sebastian Link to comment Share on other sites More sharing options...
lucianc Posted November 26, 2007 Share Posted November 26, 2007 You can do that with evalutionType="Auto". Check out the "jasper" sample from the JR project distribution for a running example. HTH,Lucian Link to comment Share on other sites More sharing options...
BatiB80 Posted November 27, 2007 Author Share Posted November 27, 2007 Hi Lucian, thanks for your answer, but this seems not to be working for me. If I directly place the sum field in my detail band and set the evaluation type to auto everything is fine. In each detail band I have the same value for sum. But I try to use the field in another varible to calculate a percentage value. In this case the sum only contains the sum of all values printed until now. For example: Count | Sum should be | % should be | % is1 | 9 | 1/9 = 11% | 1/1 = 100%3 | 9 | 3/9 = 33% | 3/4 = 75%5 | 9 | 5/9 = 56% | 5/9 = 56% I tried a lot with changing evaluation type for all fields but it isn't working... Any ideas???Post edited by: BatiB80, at: 2007/11/27 07:45 Link to comment Share on other sites More sharing options...
BatiB80 Posted November 27, 2007 Author Share Posted November 27, 2007 I created two pdf-reports. Please see attachement [file name=sample1.pdf size=1506]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/sample1.pdf[/file] Link to comment Share on other sites More sharing options...
BatiB80 Posted November 27, 2007 Author Share Posted November 27, 2007 and the second one... [file name=sample2.pdf size=1510]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/sample2.pdf[/file] Link to comment Share on other sites More sharing options...
lucianc Posted November 27, 2007 Share Posted November 27, 2007 BatiB80 wrote:thanks for your answer, but this seems not to be working for me. If I directly place the sum field in my detail band and set the evaluation type to auto everything is fine. In each detail band I have the same value for sum. But I try to use the field in another varible to calculate a percentage value. In this case the sum only contains the sum of all values printed until now. evaluationTime="Auto" only works for text fields, so if you need to compute a percentage you'll have to do it in the text field itself (like the "jasper" sample does). Regards,Lucian Link to comment Share on other sites More sharing options...
BatiB80 Posted November 27, 2007 Author Share Posted November 27, 2007 OK, it's working now!!! Many thanks! :) Link to comment Share on other sites More sharing options...
dunham Posted January 17, 2018 Share Posted January 17, 2018 Cannot find -> "Check out the "jasper" sample from the JR project distribution for a running example."Where do I find that example? 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