SpreadJS 13
SpreadJS Documentation / Developer's Guide / Features / Manage Data / Understand Printing / Set Page Breaks when Printing
In This Topic
    Set Page Breaks when Printing
    In This Topic

    You can specify page breaks when printing with the setColumnPageBreak and setRowPageBreak methods.

    Using Code

    This example sets and gets column and row page breaks.

    JavaScript
    Copy Code
    activeSheet.suspendPaint();
    
    //set value
    for (var r = 0, rc = activeSheet.getRowCount(); r < rc; r++) {
    for (var c = 0, cc = activeSheet.getColumnCount(); c < cc; c++) {
    activeSheet.setValue(r, c, r + c);
    }
    }
    activeSheet.resumePaint();
    $("#button1").click(function(){
    activeSheet.setRowPageBreak(3, true);
    activeSheet.setColumnPageBreak(5, true);
    alert(activeSheet.getRowPageBreak(3));
    alert(activeSheet.getColumnPageBreak(5));
    spread.print(0);
    })
    
    See Also