Bug 46703 - There is no setDisplayZeros(boolean) method in HSSFSheet
Summary: There is no setDisplayZeros(boolean) method in HSSFSheet
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.2-FINAL
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-12 00:58 UTC by Maksym Symonov
Modified: 2009-02-24 00:41 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maksym Symonov 2009-02-12 00:58:04 UTC
There are setDisplayGridlines() and other methods, which call
protected Sheet HSSFSheet.getSheet() and then Sheet.windowTwo.setDisplayGridlines(). There is setDisplayZeros() method in WindowTwoRecord class, but it can't be called from HSSFSheet.
Fix of it is easy to implement by adding getter/setter methods to HSSFSheet and Sheet.

Currently the way to implement it is using of reflection:

Field sheetField = HSSFSheet.class.getDeclaredField( "sheet" );
			sheetField.setAccessible( true );
			Sheet sheet = (Sheet)sheetField.get( hssfSheet );
			
			Field windowTwoRecordField = Sheet.class.getDeclaredField( "windowTwo" );
			windowTwoRecordField.setAccessible( true );
			WindowTwoRecord windowTwoRecord = (WindowTwoRecord)windowTwoRecordField.get( sheet );
			windowTwoRecord.setDisplayZeros( false );
Comment 1 Yegor Kozlov 2009-02-24 00:41:44 UTC
Fixed in r747307. 

I added setDisplayZeros / isDisplayZeros to HSSFSheet, XSSFSHeet and common interface org.apache.poi.ss.usermodel.Sheet.

Regards,
Yegor