marco12 Posted July 23, 2010 Share Posted July 23, 2010 Hi, I need to generate some sort of crosstab report, i.e.: values which have row and column headers row and column headers are actually hierarchies of headers (groups)There seems to be no problem with the requirements above, but I also have: each value is of arbitrary type or empty which means multiple classes per row multiple classes per column Can this be done with JasperReports? Brgds,Marco Link to comment Share on other sites More sharing options...
marciopd Posted July 24, 2010 Share Posted July 24, 2010 Maybe you could use a value object to wrap the crosstab data. Link to comment Share on other sites More sharing options...
marco12 Posted July 25, 2010 Author Share Posted July 25, 2010 Thx, this is my plan if nobody tells me better. Do you know which methods the wrapper needs to provide (toString, compare, format???) or is there an interface defined to implement? Do you know where I can read something how the class.name parameter is used in JR? Thx,Marco Link to comment Share on other sites More sharing options...
marco12 Posted July 29, 2010 Author Share Posted July 29, 2010 Hi,So far I did not find a reasonable way to use wrapped values because JRCompiler calls JRVerifier which checks against a hard coded list of class names.There is no way to register another Verifier. All methods are private in the class hierarchy. So I cannot override, can I?In the end it seems to be a quite inflexible architecture. Why does it not allow arbitrary classes which implement a required interface?Anyway, I appreciate any idea to progress before sending JR to hell.brMarco Link to comment Share on other sites More sharing options...
lucianc Posted July 29, 2010 Share Posted July 29, 2010 What exactly do you intend to use your values for?JR imposes restrictions on text field expressions, but crosstab group buckets can use arbitrary classes. And for text fields, you can always do $V{..}.toString() to display any type of value.Regards,Lucian Link to comment Share on other sites More sharing options...
marco12 Posted July 29, 2010 Author Share Posted July 29, 2010 Hi Lucian,Thx for your answer.Actually I create the design and report via DynamicJasper. I have not found out yet how exactly it happens, I have DJ create a crosstab with measures of the className ValueWrapper and JRVerifier then checks measures of the className ValueWrapper but which are JRTextFields.I assume that all measure fields (element of element of JRCrossTab) are JRTextFields at that stage. But maybe DJ brings in the limitation by alway defining measures as JRTextFields???But if this was the case how could a Formatter work which process at the time of report generation and most probably needs the true type of the data to format - not a string representation?I do not want to process all as text fields to avoid loosing features like formating which can not reasonably work with text representations.I do not have a problem to implement any need method for my ValueWrapper but I need this type to pass the JRVerifier.brMarco Link to comment Share on other sites More sharing options...
lucianc Posted July 30, 2010 Share Posted July 30, 2010 JR allows you to use any value types for crosstab measures, as long as you have Nothing/Last or First as calculation, or you implement an incrementer that nows how to sum values of that type. You can't directly display that value in a text field, you need to convert it to a String, a numerical value or a date value.I don't know how DynamicJasper works and how well it supports such non-standard cases. If you want to learn what JR can do, I suggest directly creating a JR report and not going through third party tools.I don't understand the part about the formatter. What/where/when do you want to process with it?Regards,Lucian 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