Bug 51481

Summary: Office 2007 warning if using autofilter
Product: POI Reporter: Roland <bug.poi2>
Component: HSSFAssignee: POI Developers List <dev>
Status: VERIFIED FIXED    
Severity: normal CC: bug.poi2
Priority: P2    
Version: 3.7-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: with POI generated xls with autofilter
new example

Description Roland 2011-07-06 12:59:26 UTC
Created attachment 27263 [details]
with POI generated xls with autofilter

If I set an autofilter to a sheet, I get a warning during open the file in MS Excel 2007 just like this: Office file check: "Problem during open the file. Open the file can be dangerous." (I get only a german error "Office-Dateiüberprüfung: Problem bei dem Versuch, diese Datei zu öffnen. Das Öffnen der Datei kann gefährlich sein.")
If I open the file after the warning the file is correctly opened.
If I don't set the autofilter, MS Excel opens the file without any warnings.
Comment 1 Yegor Kozlov 2011-07-06 13:37:27 UTC
Please try with 3.8-beta3. Some bugs with autofilters have been fixed since POI-3.7.

If the problem is still there, please post a sample code that generates the problematic output.

Yegor
Comment 2 Roland 2011-07-07 14:53:17 UTC
Created attachment 27270 [details]
new example
Comment 3 Roland 2011-07-07 15:01:54 UTC
I have tested now POI version 3.8-beta3.
In the attachment you will find the java class (Test_51481_autofilter.java) to create the xls (test_excel_HSSFPOI.xls).
If I open test_excel_HSSFPOI.xls with Office 2003 I dont get any warning. If I open this file with Office 2007 I get the warning.
I have saved test_excel_HSSFPOI.xls with Office 2003 (test_excel_Office2003.xls).
I can open this file in Office 2007 without any warning.
I have saved test_excel_HSSFPOI.xls with Office 2007 (test_excel_Office2007.xls).

Roland
Comment 4 Yegor Kozlov 2011-07-20 11:11:28 UTC
Should be fixed in r1148700.

POI didn't insert a but of data related to autofilter: it appears that Excel 2003 tolerated missing FtCbls sub-record while Excel 2007 and above don't. 

Please try with the latest build from trunk. Daily builds can be downloaded from here: http://encore.torchbox.com/poi-cvs-build/

Yegor
Comment 5 Roland 2011-08-13 20:09:51 UTC
I have tested now with the jars from ...beta4-20110813.jar.
It's working - great !
I have tested the generated xls in Office 2007 and 2003.

Roland