alan.tham_1 Posted December 17, 2022 Share Posted December 17, 2022 I am trying to create Jasper Report with crosstab by writing JRXML with DTOs.I am trying to create rows dynamic number of chargeCodes and their total. It looks something like this:jobNochargeCodeAchargeCodeBTotaljobNoABC100.10300.30400.40jobNoDEF200.20400.40600.60In my Java backend, I have DTO which looks like thisclass MyDTO {private String jobNo;private List <String> chargeCode = new ArrayList <> ();private List <BigDecimal> chargeCodeTotal = new ArrayList <> ();}[/code]where the list codeCode contains chargeCodeA, chargeCodeB for jobNoABCand chargeCodeTotal contains 100.10, 300.30 for jobNoABC also.In my JRXML, I have included in sample.jrxml But I am getting error:java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.Comparable at org.apache.commons.collections.comparators.ComparableComparator.compare(ComparableComparator.java:91)I am not sure how to create infinite number of chargeCodes using JRXML.And I cannot use Dynamic Jasper. I can only think of crosstab. Please help. Thanks. Link to comment Share on other sites More sharing options...
mahadiosb Posted December 28, 2022 Share Posted December 28, 2022 Did you find any solution? 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