salvois / LargeXlsx

A .net library to write large Excel files in XLSX format with low memory consumption using streamed write.
Other
204 stars 34 forks source link

Added feature to add header/footer to worksheets. #33

Closed soend closed 1 year ago

soend commented 1 year ago

I have added very functionality to write headers and footers to excel sheets.

Usage can be seen in the HeaderFooter test case what i have added.

In current implementation person writing the code to add header/footer needs to know the formatting codes when creating the header/footer string. For example &RSomeTextHere - where &R code specifies the beginning of the right section. More information about the codes can be found in the links below.

When adding headers/footers its important to remember oddHeader and oddFooter are the main fields to fill. Only when using different odd even headers footers (differentOddEven: true) you would fill evenHeader or evenFooter.

If there is more tests needed or any other change please let me know and i will do them.

Some links to get more information about headerFooter: OpenXML HeaderFooter class definition and description of available attributes Description of formatting codes what can be used in header and footer Another good table about codes to use in header and footer from DevExpress

soend commented 1 year ago

I have added header and footer section to the README file. Not sure if readme needs example of usage also or not, currently its not there.

salvois commented 1 year ago

Thanks @soend! I'm merging your pull request. I'd like to experiment a little bit more with the API before finalizing a release (just for fun), but in my opinion usage is much clearer to people not knowing the specification, now. Salvo