|Summary:||Surface XSSF header/footer attributes|
|Product:||POI||Reporter:||Mark Murphy <jmarkmurphy>|
|Component:||XSSF||Assignee:||POI Developers List <dev>|
Description Mark Murphy 2017-03-18 12:21:51 UTC
The different First Page, and different Even/Odd header/footer attributes of XSSF spreadsheets are set automatically when the appropriate methods are called. These attributes cannot be turned off, and there is no way to set the alignWithMargins and scaleWithDoc attributes.
Comment 1 Mark Murphy 2017-03-20 11:38:32 UTC
In working through this feature, I have noticed that creating an XSSFEvenHeader, or an XSSFFirstHeader sets the differentOddEven or differentFirst attributes respectively. And, setting the text for a header to an empty string removes that header, but does not attempt to remove the differentOddEven or differentFirst attributes. I am thinking that setting the text on an XSSFEvenHeader to the null string should remove the differentOddEven attribute if the XSSFEvenFooter is not set, and similarly setting text on the XSSFEvenFooter should remove the differentOddEven attribute if necessary. Same thing for differentFirst with respect to XSSFFirstHeader and XSSFFirstFooter. Any objections?
Comment 2 Greg Woolsey 2017-03-21 20:16:15 UTC
Sounds appropriate to me.
Comment 4 Javen O'Neal 2017-11-12 00:46:01 UTC
Make sure to document any surprising behavior in the javadoc. It sounds like some of this functionality would be better implemented in a different class to make the global behavior less surprising. But I am not familiar enough with printing, headers, or footers to suggest something better.
Comment 5 Mark Murphy 2017-11-13 12:21:19 UTC
(In reply to Javen O'Neal from comment #4) > Make sure to document any surprising behavior in the javadoc. It sounds like > some of this functionality would be better implemented in a different class > to make the global behavior less surprising. But I am not familiar enough > with printing, headers, or footers to suggest something better. I will try to improve the documentation. I Created the XSSFHeaderFooterProperties class to handle global behavior of these properties. I can add some examples and a section in the Quick Guide as well. Is there somewhere else that you experienced unexpected behavior?