Skip to content

Commit

Permalink
Fixed error with Report for one grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
yamelsenih committed Dec 21, 2024
1 parent 5639b6f commit e57225d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main/java/org/spin/report_engine/data/ReportInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,22 @@ private void processChildren(Row parent, int levelAsInt) {
List<Row> children = parent.getChildren();
PrintFormatItem previosLevelGroup = groupLevels.get(levelAsInt - 1);
PrintFormatItem levelGroup = groupLevels.get(levelAsInt);
if(levelGroup == null || previosLevelGroup == null) {
if((levelGroup == null && groupLevels.size() > 1) || previosLevelGroup == null) {
return;
}
rows.stream().filter(row -> {
return row.getLevel() == levelGroup.getSortSequence() && compareRows(parent, row, levelAsInt);
if(levelGroup == null && row.getLevel() > parent.getLevel() && compareRows(parent, row, levelAsInt)) {
return true;
}
if(levelGroup != null && row.getLevel() == levelGroup.getSortSequence() && compareRows(parent, row, levelAsInt)) {
return true;
}
return false;
}).forEach(row -> children.add(row));
// No Recursive
if(groupLevels.size() == 1) {
return;
}
int nextLevel = levelAsInt + 1;
if(nextLevel < groupLevels.size()) {
children.forEach(child -> processChildren(child, nextLevel));
Expand Down

0 comments on commit e57225d

Please sign in to comment.