cuba-platform / reports

CUBA Reports Addon
https://www.cuba-platform.com/
Apache License 2.0
9 stars 4 forks source link

Cross Tab report generates corrupted xlsx file #239

Closed longirun closed 4 years ago

longirun commented 4 years ago

Important

Before this issue, the following one should be fixed: 238.

Environment

com.haulmont.reports: 7.1.0

Description of the bug

Run report GridExportReport.zip

Generated file Шахматка (22).xlsx is corrupted:

Now and then, workbooks get damaged. In this case, we made some temporary repairs so that you can open it in Reading View.
Hide technical details

Repaired Part: /xl/worksheets/sheet1.xml part with XML error.  Catastrophic failure Line 18, column 27.

Datasets for Band apartments, apartments_dynamic_header and apartments_master_data are empty.

To reproduce the issue, do following:

Edit -> Root -> apartments -> Bands Replace Band apartments returning value

return AppBeans.get('tgrealestate_GridExportReportService')
               .getApartmentsRowData(realtyObject, manager, developer, contractor)

with return []

Replace Band apartments_dynamic_header returning value

return AppBeans.get('tgrealestate_GridExportReportService')
               .getApartmentsDynamicHeaderRowData(realtyObject, manager, developer, contractor)

with return [['roomNum': '']] Replace Band apartments_master_data returning value

return AppBeans.get('tgrealestate_GridExportReportService')
               .getFloorNumbers(realtyObject, manager, developer, contractor)

with return [['floorNum': '']]

  1. Run report.

AR: Microsoft Office reports corrupted file (LibreOffice does not report any issues) ER: File is ok.

Possible fix (actually bad solution, a better one should be found) attached in file TgCrossTabExtractionController.zip.