awalker89 / openxlsx

R package for .xlsx file reading and writing.
Other
364 stars 78 forks source link

Feature request: Argument to allow printing of gridlines in Page Setup #371

Open pm321 opened 6 years ago

pm321 commented 6 years ago

Expected Behavior

Would it be possible to add an argument to the existing pageSetup function to enable page Setup > Sheet > Print > Gridlines to be selected?

Actual Behavior

Steps to Reproduce the Problem

(please attach an example xlsx file if possible)

1.

2.

3.

sessionInfo()

kainhofer commented 6 years ago

The showGridLines function should implement this:

showGridLines(wb, 1, showGridLines = FALSE)

If this fixes your issue, can this report be closed?

pm321 commented 6 years ago

The showGridLines function does not resolve this issue. showGridLines affects the appearance of the worksheet only. The issue is about printing the workbook showing gridlines. openxlsx_print_with_grid_lines_issue_371.pdf The attached document explains the difference and makes the request more explicit.

kainhofer commented 6 years ago

Thank you for the clarification. Those print options are store in the worksheet's xml as

<worksheet ...>
   ...
  </sheetData>
  <printOptions gridLines="1" headings="1"/>
  <pageMargins ...>
  <pageSetup ...>
</worksheet>

So far, openxlsx does not implement (i.e. load or generated) the printOptions element at all, so the implementation of this feature would mean to: