Bug 51481 - Office 2007 warning if using autofilter
Summary: Office 2007 warning if using autofilter
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.7-FINAL
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2011-07-06 12:59 UTC by Roland
Modified: 2011-08-13 20:09 UTC (History)
1 user (show)

with POI generated xls with autofilter (23.50 KB, application/vnd.ms-excel)
2011-07-06 12:59 UTC, Roland
new example (8.18 KB, application/octet-stream)
2011-07-07 14:53 UTC, Roland

Note You need to log in before you can comment on or make changes to this bug.
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.

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).

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/

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.