[]
        
(Showing Draft Content)

IVPageBreak

Interface IVPageBreak


public interface IVPageBreak
Represents a vertical page break.

A vertical page break defines where printed content is split into the next page across columns. You can obtain an IVPageBreak from IWorksheet.getVPageBreaks(), inspect its location with getLocation(), determine whether it spans the full sheet or only the print area with getExtent(), or remove it with delete().


 worksheet.getRange("A1:F10").setValue("Data");
 IVPageBreaks pageBreaks = worksheet.getVPageBreaks();
 pageBreaks.add(worksheet.getRange("D1"));
 IVPageBreak pageBreak = pageBreaks.get(0);
 IRange location = pageBreak.getLocation();
 PageBreakExtent extent = pageBreak.getExtent();
 
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deletes this vertical page break.
    Gets the extent of the specified page break: the entire worksheet or only the print area.
    Gets the range that defines the page-break location.
  • Method Details

    • delete

      void delete()
      Deletes this vertical page break.

      Use this method to remove a page break that was previously added to the worksheet's IWorksheet.getVPageBreaks() collection.

      
       worksheet.getRange("A1:G5").setValue(new Object[][] {
           {"Name", "Q1", "Q2", "Q3", "Q4", "Total", "Region"},
           {"Alice", 10, 12, 11, 9, 42, "East"}
       });
       IVPageBreak pageBreak = worksheet.getVPageBreaks().add(worksheet.getRange("F3"));
       pageBreak.delete();
       
    • getExtent

      PageBreakExtent getExtent()
      Gets the extent of the specified page break: the entire worksheet or only the print area.

      This method returns a PageBreakExtent value that indicates whether the vertical page break applies to the full sheet or only within the print area.

      
       IVPageBreak pageBreak = worksheet.getVPageBreaks().add(worksheet.getRange("F3"));
       PageBreakExtent extent = pageBreak.getExtent();
       String scope = extent == PageBreakExtent.PageBreakPartial ? "Print area" : "Full sheet";
       
      Returns:
      The PageBreakExtent that specifies whether the page break applies to the entire worksheet or only within the print area.
    • getLocation

      IRange getLocation()
      Gets the range that defines the page-break location.

      Horizontal page breaks are aligned with the top edge of the location range; vertical page breaks are aligned with the left edge of the location range.

      
       worksheet.getRange("A1:F5").setValue(new Object[][] {
           {"Name", "Q1", "Q2", "Q3", "Q4", "Total"},
           {"Test", 100, 200, 150, 180, 630}
       });
       IVPageBreak pageBreak = worksheet.getVPageBreaks().add(worksheet.getRange("F3"));
       IRange location = pageBreak.getLocation();
       
      Returns:
      The IRange that defines the page-break location.