jmix-framework / jmix

Jmix framework
https://www.jmix.io
Apache License 2.0
695 stars 125 forks source link

Excel exporter duplicates some rows when the total count of exported rows exceeds the batch size and sorting is applied #3316

Closed KremnevDmitry closed 2 weeks ago

KremnevDmitry commented 6 months ago

Environment

Jmix version: 1.6.999-SNAPSHOT See related: #3315

Bug Description

When sorting is used, export occurs incorrectly.

Steps To Reproduce

  1. Open attached project
  2. Open Test data for exports screen
  3. Sort by number column
  4. Export all rows

Current Behavior

Number of records in the database: image

Data is exported twice, 1001 rows should be exported: image

Sample Project

TestExportExcel.zip

Flaurite commented 3 weeks ago

Jmix 1.6 introduces an export pagination strategy that takes into account the order of the rows. See https://github.com/jmix-framework/jmix/issues/3058.

Use the following application property:

jmix.gridexport.export-all-pagination-strategy=limit-offset

Jmix 2.x has the same fix for the problem. See related issue in the description.

Flaurite commented 3 weeks ago

Fixed the duplication of exported rows. The problem occurs when sorting is applied and the total count of rows exceeds the export batch size. After the fix, the exporter, by default, does not consider column sorting. To make the exporter take sorting into account, use jmix.gridexport.export-all-pagination-strategy=limit-offset, as I described above.