Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last group footer label always incorrect when the group size is 1 #84

Open
Spanner0jjm opened this issue Jun 27, 2019 · 1 comment
Open
Assignees

Comments

@Spanner0jjm
Copy link

When adding a footer label to groups, when the last group in the report contains just one element, the footer label is always incorrect (the label from the penultimate group is repeated).

Since the CustomExpression class is an interface, there is no way to correct this behaviour.

Below I include an extract of a typical DJGroup definition which creates a footer label with a CustomExpression, and a screenshot of the result it produces. You can see that the last footer label is incorrect.

The error is consistently replicated when the last group contains just one element.

Typical DJGroup creation:

DJGroup g1 = gb1.setCriteriaColumn((PropertyColumn) columnCamara).setGroupLayout(GroupLayout.VALUE_IN_HEADER)
		.addFooterVariable(columnComisionTotal, DJCalculation.SUM, groupVariables).setFooterVariablesHeight(20)
		.setFooterLabel(new DJGroupLabel(new CustomExpression() {
			private static final long serialVersionUID = -6204511174702760074L;
			
			@Override
			public String getClassName() {
				return String.class.getName();
			}
			
			@Override
			public Object evaluate(Map fields, Map variables, Map parameters) {
				return "Total " + fields.get("camara");
			}
		}, groupVariablesLabel, LabelPosition.LEFT)).build();

Incorrect last footer:
Ultimo grupo incorrecto
Any help would be appreciated.

@juanalvarezg
Copy link
Member

I was able to reproduce this and did some fixes...
If you are familiar with JasperReport internals, this is a pain in the neck.
Please try new versions to check if the problem is solved

@juanalvarezg juanalvarezg self-assigned this Mar 23, 2020
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

No branches or pull requests

2 participants