[]
Iterable<IHPageBreak>Use this collection to enumerate existing horizontal page breaks, retrieve a page break by index, or add a new break above a specified range. Obtain an instance from IWorksheet.getHPageBreaks().
worksheet.getHPageBreaks().add(worksheet.getRange("A10"));
IHPageBreaks pageBreaks = worksheet.getHPageBreaks();
IHPageBreak pageBreak = pageBreaks.get(0);
get(int index) IHPageBreak by index.intgetCount()forEach, iterator, spliteratorUse this method to determine how many horizontal page breaks are currently in the collection returned by IWorksheet.getHPageBreaks().
worksheet.getHPageBreaks().add(worksheet.getRange("A4"));
int count = worksheet.getHPageBreaks().getCount();
IHPageBreak by index.The index is zero-based. An IndexOutOfBoundsException is thrown if the index is outside the collection.
worksheet.getHPageBreaks().add(worksheet.getRange("A4"));
IHPageBreak pageBreak = worksheet.getHPageBreaks().get(0);
index - The zero-based index of the horizontal page break.IHPageBreak object at the specified index.IndexOutOfBoundsException - if index is outside the collection.The new page break is inserted above the specified range. Use IWorksheet.getHPageBreaks() to access the collection of horizontal page breaks for a worksheet.
worksheet.getRange("A1:B5").setValue(new Object[][] {
{"Name", "Value"}, {"A", 100}, {"B", 200}, {"C", 300}, {"D", 400}
});
IRange before = worksheet.getRange("A4");
IHPageBreak pageBreak = worksheet.getHPageBreaks().add(before);
before - The range above which the new page break will be added.IHPageBreak object.