[]
        
(Showing Draft Content)

IVPageBreaks

Interface IVPageBreaks

All Superinterfaces:
Iterable<IVPageBreak>

public interface IVPageBreaks extends Iterable<IVPageBreak>
Represents the collection of vertical page breaks within the print area.

Use this collection to add, access, and iterate vertical page breaks on a worksheet. A vertical page break added through this collection is positioned to the left of the specified range.


 worksheet.getRange("A1:F10").setValue("Data");
 IVPageBreaks pageBreaks = worksheet.getVPageBreaks();
 pageBreaks.add(worksheet.getRange("D1"));
 IVPageBreak pageBreak = pageBreaks.get(0);
 
  • Method Details

    • getCount

      int getCount()
      Returns the number of objects in the collection.

      This method returns the number of vertical page breaks contained in this collection within the print area.

      
       IVPageBreaks pageBreaks = worksheet.getVPageBreaks();
       pageBreaks.add(worksheet.getRange("C1"));
       pageBreaks.add(worksheet.getRange("F1"));
       int count = pageBreaks.getCount();
       
      Returns:
      The number of objects in the collection.
    • get

      IVPageBreak get(int index)
      Gets the IVPageBreak at the specified index in the collection.

      Use this method to access a vertical page break that has been added to the worksheet print area through add(IRange) or other worksheet page break operations.

      
       worksheet.getRange("A1:F3").setValue(new Object[][] {
           {"Name", "Q1", "Q2", "Q3", "Q4", "Total"},
           {"North", 100, 120, 110, 130, 460}
       });
       IVPageBreaks pageBreaks = worksheet.getVPageBreaks();
       pageBreaks.add(worksheet.getRange("D1"));
       IVPageBreak pageBreak = pageBreaks.get(0);
       IRange location = pageBreak.getLocation();
       
      Parameters:
      index - The index of the collection.
      Returns:
      The IVPageBreak object at the specified index.
    • add

      IVPageBreak add(IRange before)
      Adds a vertical page break within the print area.

      The page break is aligned with the left edge of the specified range.

      
       worksheet.getRange("A1:H2").setValue(new Object[][] {
           {"Name", "Q1", "Q2", "Q3", "Q4", "Total", "Region", "Status"},
           {"Test", 100, 120, 140, 160, 520, "East", "Open"}
       });
       IVPageBreak pageBreak = worksheet.getVPageBreaks().add(worksheet.getRange("F2"));
       
      Parameters:
      before - The range whose left edge defines where the new page break is added. If before is null, no page break is added.
      Returns:
      The new IVPageBreak object, or null if before is null.
      Throws:
      IllegalArgumentException - if before starts in the first column of the worksheet.
      IllegalStateException - if the maximum number of vertical page breaks has been reached.