on ‎2020 Nov 04 3:57 PM
Hi,
after upgrading from version 220 to the latest CR for Eclipse version we encountered a problem with changed behavior in sorting and grouping records in reports. (actually the problem seems to be introduced with version 225)
We created a testcase and a test report to show the different results.
The report wants to sort by Purchase Order number ascending displaying multiple positions per page belonging to the same supplier (that is the grouping part). Every time the supplier changes (because of the sorting of the purchase order number) a new page is created.
Please see the attached files :
* the "correct" report result: https://github.com/godyo-business-solutions/hosted-files/blob/main/ReportGroupAndSortTest_purchaseor...
* the incorrect report(purchase order not sorted): https://github.com/godyo-business-solutions/hosted-files/blob/main/ReportGroupAndSortTest_purchaseor...
* the report and the sample Java Code can be also be found here: https://github.com/godyo-business-solutions/hosted-files
To influence the sorting and grouping we call several CR functions. Excerpt from the complete example linked above:
for (final ISort iSort : sorts) {
final ISort findSort = gsCtrl.findSort(iSort.getSortField());
if (findSort == null) {
continue;
}
try {
gsCtrl.modifySortDirection(iSort, SortDirection.noSort);
} catch (final ReportSDKException | IndexOutOfBoundsException e) {
}
}
int anz = 0;
final int size = groups.size();
for (int i = 0; i < buildSorts.size(); i++) {
if (i == size) {
// keine gruppe mehr da
break;
}
// Gruppensortierungen überprüfen, anpassen
final ISort bSort = buildSorts.get(i);
final IGroup iGroup = groups.get(i);
try {
if (iGroup.getSort().getSortField().getFormulaForm().equals(bSort.getSortField().getFormulaForm())) {
gsCtrl.modifySortDirection(iGroup.getSort(), bSort.getDirection());
anz++;
} else {
// andere Sortierreihenfolge als Gruppierung => abbrechen
break;
}
} catch (final IndexOutOfBoundsException | ReportSDKException e) {
}
}
int k = 0;
while (sorts.size() > k) {
try {
final ISort findSort = rsCtrl.findSort(sorts.get(k).getSortField());
if (findSort == null) {
k++;
continue;
}
rsCtrl.remove(findSort);
} catch (final ReportSDKException e) {
k++;
}
}
sorts.removeAllElements();
int sortAnz = anz;
for (int i = anz; i < buildSorts.size(); i++) {
final Sort newSort = (Sort) buildSorts.get(i);
// alte Sortierungen entfernen (auch nach einem Refresh die
// neuen)
final ISort findSort = rsCtrl.findSort((newSort).getSortField());
if (findSort != null) {
rsCtrl.remove(findSort);
}
// neue Sortierung hinzufügen
try {
rsCtrl.add(i, newSort);
sortAnz++;
} catch (final ReportSDKSortException e) {
}
}
for (int i = 0; i < groups.size(); i++) {
final ISort gSort = groups.get(i).getSort();
if (gSort.getDirection() == SortDirection.noSort && rsCtrl.findSort((gSort).getSortField()) == null) {
final ISort newGSort = new Sort(gSort);
newGSort.setDirection(SortDirection.ascendingOrder);
rsCtrl.add(sortAnz + i, newGSort);
}
}
The used ReportConverter class internally just exports the ReportClientDocument to PDF by calling
report.getPrintOutputController().export(pdfOptions)
The used PDFTextExtractor and the checkInOrder are just helper methods for the test to check the order of strings in the pdf.
Any hints and suggestions are more than welcome!
Bye Peter
BTW: we wanted to issue a single incident ticket for fixing this but that seems not available anymore (sadly)
Request clarification before answering.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.