This project has moved and is read-only. For the latest updates, please go here.

Option to use same header/footer on all pages

Feb 14, 2012 at 1:53 PM

Hello Manuel,

On the "Headers and Footers Tab" page of the Documentation, it says this:

Note 1
There is no option to turn on/off the "Different odd and even pages" or "Different first page". This is because ClosedXML always uses all headers even if it leaves them blank.

Is there a reason it was designed this way?  The Excel default is to have headers/footers the same on all pages (i.e. "Different odd and even pages" and "Different first page" are unchecked).

Unfortunately, my users are getting confused because they expect to change the header/footer on the first page, and have those changes apply to the rest of the document, but the changes only apply to the first page.  Instead, I have to tell them to: a) uncheck those two boxes, or b) make the same changes to the first three pages of the document.

I'll soon be trying to fix this myself with OpenXML, but first I wanted to ask if it could be included in ClosedXML.

Thanks for all your hard work,

Feb 15, 2012 at 4:10 AM

I have no idea what I was thinking back then but I don't see any reason to not include those settings (and make the default like Excel). Pick up the latest check in, I added the following properties to PageSetup:

        Boolean DifferentFirstPageOnHF { getset; }
        Boolean DifferentOddEvenPagesOnHF { getset; }