Bug 59881

Summary: [PATCH] Fix for blank cells in headers in DB in D* functions
Product: POI Reporter: Patrick Böker <patrick.boeker>
Component: SS CommonAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: enhancement Keywords: PatchAvailable
Priority: P2    
Version: 3.15-dev   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: dstar_empty_header_fix.patch
DGet.xls

Description Patrick Böker 2016-07-18 15:41:47 UTC
Created attachment 34052 [details]
dstar_empty_header_fix.patch

The D* functions errored out when the database headers contained blank cells. Excel 2013/Win7 doesn't (I didn't try with other Excel versions).
This patch fixes that.
Test included.
Comment 1 Patrick Böker 2016-07-18 15:43:46 UTC
Created attachment 34053 [details]
DGet.xls

Updated test xls file.
Comment 2 Javen O'Neal 2016-07-18 18:23:26 UTC
(In reply to Patrick Zimmermann from comment #0)
> Test included.

Could you re-upload your patch? I did not see a unit test for this.
Comment 3 Patrick Böker 2016-07-19 07:15:28 UTC
The respective test is in the DGet.xls file. That file should replace test-data/spreadsheet/DGet.xls
Comment 4 Javen O'Neal 2016-07-19 08:04:38 UTC
I see the added test in DGet.xls now

Row 102:
> empty cells
>     =DGET(G103:I104,"Three",K103:L104)
>     don't fail with empty cells in DB headers

Applied in r1753346. Thanks for the patch! This will be included in POI 3.15 beta3.
Comment 5 Javen O'Neal 2016-07-19 08:09:36 UTC
(In reply to Patrick Zimmermann from comment #0)
> Excel 2013/Win7 doesn't [error out] (I didn't try with other Excel versions).

Formula evaluation does not error out in LibreOffice 5.0.3.2, either.