pageBreak {openxlsx} | R Documentation

## add a page break to a worksheet

### Description

insert page breaks into a worksheet

### Usage

    pageBreak(wb, sheet, i, type = "row")

### Arguments

`wb` | A workbook object
`sheet` | A name or index of a worksheet
`i` | row or column number to insert page break.
`type` | One of "row" or "column" for a row break or column break.

### See Also

`addWorksheet`

### Examples

    wb <- createWorkbook()
    addWorksheet(wb, "Sheet 1")
    writeData(wb, sheet = 1, x = iris)

    pageBreak(wb, sheet = 1, i = 10, type = "row")
    pageBreak(wb, sheet = 1, i = 20, type = "row")
    pageBreak(wb, sheet = 1, i = 2, type = "column")

    saveWorkbook(wb, "pageBreakExample.xlsx", TRUE)
    ## In Excel: View tab -> Page Break Preview

[Package openxlsx version 4.1.0 Index]