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.
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?
Sounds appropriate to me.
Added r1814950
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.
(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?
(In reply to Mark Murphy from comment #5) > Is there somewhere else that you experienced unexpected behavior? I haven't used these features or even read the existing javadocs, so no.