NPOI
NPOI copied to clipboard
GridLines printing is being set
When I save a workbook I noticed that the print gridlines option is being set without ever being modified by the program. I traced the problem to how the printOptions (CT_PrintOptions) records is being output. The generated record is:
<printOptions horizontalCentered="1" verticalCentered="0" headings="0" gridLines="0" gridLinesSet="0"/>
Which Excel 2016 interprets as the option being set (I assume that it is a default value of gridLines when gridLinesSet is 0). If I set gridLinesSet to 1, then it work alright.
<printOptions horizontalCentered="1" verticalCentered="0" headings="0" gridLines="0" gridLinesSet="1"/>
By the way, the equivalent record generated by Excel is much smaller because default values are not saved:
<printOptions horizontalCentered="1"/>