Skip to content

Usage of global header for jasper reports#21

Merged
mgrochalskisoldevelo merged 3 commits into
masterfrom
ODRC-24
Feb 27, 2026
Merged

Usage of global header for jasper reports#21
mgrochalskisoldevelo merged 3 commits into
masterfrom
ODRC-24

Conversation

@kszymankiewicz-sd
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@mgrochalskisoldevelo mgrochalskisoldevelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks solid, but I have a few concerns.

We're going to use one resource bundle for all report translations if I understood correctly. Let's keep it in check, there shouldn't be a lot of different translations but we may consider using global bundle + report specific ones if it rises a lot.

Also when it comes to global header injection, is there any restriction like it needs to be compiled in the same jasper studio version as the main report? I believe we don't have specified one jasper studio/reports that is being used, so a lot of different versions can be spotted between different reports, or dependencies. Maybe it is a good time to standarize it.

I see <printWhenExpression><![CDATA[new Boolean($V{PAGE_NUMBER}.intValue()==1)]]></printWhenExpression>, is the header printed only on the first page? Is it expected behaviour? If it is not how will it affect the performance for reports with hundreds or thousands of pages.

Edit:
Also before merge, please add tests to ensure there is at least 80% coverage on the new code.

@kszymankiewicz-sd
Copy link
Copy Markdown
Contributor Author

Separating translations resource bundles might be a great idea, I'd suggest separating bundles for each module in order to avoid having many files (especially when there will be multiple languages). But right now I'd prefer to stick to one file at least till we have most of reports edited to use translations.

Oldest version of JasperSoft studio used in some modules is 6.4.0. I have compiled header in version 6.21.5 and most of standard components are compatible (and even the same). The core report module uses jasperreports:6.5.1 dependency.

Printing the header only on the first page is intentional. Adding it to section that would populate it on every page will increase the generation time - header/subreport will be generated for each page separately.

I have added multiple unit tests.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@mgrochalskisoldevelo
Copy link
Copy Markdown
Contributor

It seems like jacoco is failing to count Power Mock tests. However I verified that tests were indeed added. For the time being I'm merging this ticket.

@mgrochalskisoldevelo mgrochalskisoldevelo merged commit c95883f into master Feb 27, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants