birt icon indicating copy to clipboard operation
birt copied to clipboard

Exception "invalid cell range" when using Spudsoft Excel emitter with AutoFilter ON

Open rneumerkel opened this issue 2 years ago • 3 comments

After upgrading from BIRT 4.3 to BIRT 4.9 we experience the following behaviour:

When trying to export a report consisting of a text element and a table element using the Spudsoft Excel emitter with AutoFilter enabled, we sometimes get the following exception from within Apache POI (CellRangeAddress.java):

java.lang.IllegalArgumentException: Invalid cell range, having lastRow < firstRow || lastCol < firstCol

This always happens when the dataset returns no results, leaving just the header row of the table along with the text field preceeding it. In this case, when trying to apply the auto filter, the starting row equals 1 while the last row equals 0, hence the exception from Apache POI.

Note 1: this ONLY happens when there is at least one text-element or label preceeding the empty table. Note 2: if the table DOES have values, then the report is generated without errors

I have attached a sample report using the built-in datasource ClassicModel to demonstrate this behaviour.

How to reproduce:

  1. Open the attached report in Eclipse BIRT designer 4.9
  2. Run "View Report as XLS_Spudsoft" or "XLSX"

How to fix:

In uk.co.spudsoft.birt.emitters.excel.handlers.TopLevelTableHandler.endTable(..) (and possibly other locations), the code should check if startrow <= endrow and startCol <= endCol before attempting to call new CellRangeAddress(..)

bug_report.zip

rneumerkel avatar Jun 21 '22 09:06 rneumerkel

Thanks for reporting. Can you supply a patch?

https://github.com/eclipse/birt/blob/master/CONTRIBUTING.md

wimjongman avatar Jun 21 '22 13:06 wimjongman

Yes, that should be possible.

rneumerkel avatar Jun 21 '22 13:06 rneumerkel

Thank you. It is important that you:

  • Create an Eclipse account
  • Set your Github id in the Eclipse account
  • Sign the Eclipse Contributor Agreement
  • Use the e-mail address in your Eclipse account to commit

wimjongman avatar Jun 21 '22 13:06 wimjongman

The issue will be fixed with PR #1431

speckyspooky avatar Sep 23 '23 14:09 speckyspooky

The fix is included in the latest nightly built of BIRT 4.14

speckyspooky avatar Oct 01 '23 12:10 speckyspooky