简体   繁体   中英

How can the Excel print area be set for a worksheet using the openxlsx R package?

使用R包openxlsx,如何为工作表设置打印区域,以便在打开用openxlsx创建的Excel工作表时,打印区域已经定义?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM