Reputation: 181
Using R package openxlsx, how can the print area be set for a worksheet so that when the Excel worksheet created with openxlsx is opened, the print area is already defined?
Upvotes: 0
Views: 838
Reputation: 21
The "fitToWidth = TRUE" option of "pageSetup()" function from openxlsx enables printing of active contents of an Excel sheet to be printed within one page. You can also set "orientation = landscape" if your contents are too wide. The "scale = " option may be used manually to adjust the content print result.
Upvotes: 1
Reputation: 11
I believe the way to solve things like this is to start with an excel workbook. Define the print area for this template, then loadWorkbook into R. Be careful with any other pagesetup stuff that you want to do in R, however. I can only get either excel's preexisting page setup working or R's, not both.
Upvotes: 1