Reputation: 14234
How would I get a value cell [in a CrossTab widget] to stretch horizontally, rather than vertically? Stretch on overflow stretches the cell vertically, rather than horizontally.
Upvotes: 3
Views: 4415
Reputation: 31171
If I recall correctly, cells in JasperReports were neither designed nor implemented to stretch horizontally. This was a conscious decision made by the lead developers.
You can make them stretch by generating the cross-tab cells according to the width of the data (that sentence alone should give you a feel for the scope of creating a generic solution to this problem). It is possible, but would involve creating your own class using the JasperReports API.
Imagine you have 100,000 rows of data and want the cell to auto-fit to the longest string. JasperReports would have to do one of two things:
Then you have to answer questions about white space: trim or not to trim? If the reporting software trims it, then the data coming back isn't a true representation of the information in the database. If the data isn't trimmed, then that cascades to more problems (such as unexpectedly super-long columns that look "empty"). Or you can make it one more thing that the developer needs to do.
It is not a trivial problem.
Try DynamicJasper.
Upvotes: 3