wjones14 Posted June 12, 2009 Share Posted June 12, 2009 Presently, we have a textField cell where the data is a long single String. We generated the String before sending it to the report, by concatenating a list of Strings, each separated by a comma and a space. See the last column in the attached file for an example. We're wondering if it's possible to send a textField a List of Strings, and have Jasper format the list by columns? It would be similar to how Microsoft Word allows you to format using "newsletter-style" columns. Post Edited by wjones14 at 06/12/2009 15:51 Link to comment Share on other sites More sharing options...
wjones14 Posted June 12, 2009 Author Share Posted June 12, 2009 If Jasper cannot accept a List of Strings as input for a textField, can it display an HTML table in the cell? This is a PDF report. Link to comment Share on other sites More sharing options...
wjones14 Posted June 17, 2009 Author Share Posted June 17, 2009 We figured out a way to do this so I thought I would share the answer. The report output looks like this: col1 col2 col3 col4 col5 data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data So what we did was to have col1, col2, col3, and col4 be ordinary textField elements. But col5 is a subreport. In addition to the Fields declared for col1, col2, col3, and col4, we have col5 declared as a Field of class type JasperReport. The main report's subreport properties are also Fields. And the main report's DataSource is a JRMapCollectionDataSource, so each report row contains maps with the subreport's parameter map, it's data source, and the compiled subreport. The subreport's data source is also a JRMapCollectionDataSource, created with a list of maps, each with key that matches the subreport textField expression name, and a value of the actual data. The subreport is real simple. It is simply a detail band containing a single textField. The report properties have column count set to 5 and the printOutput property is horizontal. 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