Skip to content

[JasperDynamicColumns] Fix the example to print the column headers

DMan requested to merge DManstrator/sdg-blog:master into master

When I checked out the example, the headers were not printed to the exported PDF. I managed to resolve this by increasing the height of the header band height and header row height. An alternative would be setting the font-size for the header row to 9 or below.

In addition to, the project didn't build in the beginning. This was caused by Maven not wanting to resolve the dependencies.

[...] Original error: Could not transfer artifact com.lowagie:itext:pom:2.1.7.js2 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [jasperreports (http://jasperreports.sourceforge.net/maven2, default, releases+snapshots)]

Since Maven 3.8.1 http repositories are blocked.

I updated jasperreports to the latest version (6.21.0 as of now) and resolved the compile errors. Additionally I cleaned up the code a bit.

Important notice: I set the Java Version to 8 for this project. This was mainly done to get rid of build and runtime warnings.

More details can be found in each commit message.

Generated PDF for reference: DynamicColumns13882112001194168970.pdf

Edit: Perhaps the article (https://www.solutiondesign.com/insights/building-dynamic-columns-in-jasperreports/) should be adjusted as well? Or at least the link to the repository should be updated.

Edited by DMan

Merge request reports