[]
Gets the row or column indexes that define page boundaries for the specified worksheet.
The pagination result is calculated from the current page setup of the worksheet and the
specified orientation.
If the worksheet has no print area, this method returns null.
public IList<int> GetPaginationInfo(IWorksheet worksheet, PaginationOrientation orientation)
Public Function GetPaginationInfo(worksheet As IWorksheet, orientation As PaginationOrientation) As IList(Of Integer)
| Type | Name | Description |
|---|---|---|
| IWorksheet | worksheet | The worksheet whose pagination information is retrieved. Must not be |
| PaginationOrientation | orientation | The pagination direction that determines whether row or column boundary indexes are returned. |
| Type | Description |
|---|---|
| IList<int> | A list of row or column indexes that represent the page boundaries for the specified orientation, or |
worksheet.PageSetup.PrintArea = "A1:D80";
worksheet.Range["A1:D80"].Value = 100;
PrintManager printManager = new PrintManager();
IList<int> pageBoundaries = printManager.GetPaginationInfo(
worksheet, PaginationOrientation.Vertical);
Gets the row or column indexes that define page boundaries for the specified worksheet.
The pagination result is calculated from the current page setup of the worksheet and the
specified orientation. Use keepTogetherRanges to prevent specific ranges from
being split across pages, and use repeatSettings to repeat title or tail rows or columns
for a range during pagination.
If the worksheet has no print area, this method returns null.
public IList<int> GetPaginationInfo(IWorksheet worksheet, PaginationOrientation orientation, IList<IRange> keepTogetherRanges, IList<RepeatSetting> repeatSettings)
Public Function GetPaginationInfo(worksheet As IWorksheet, orientation As PaginationOrientation, keepTogetherRanges As IList(Of IRange), repeatSettings As IList(Of RepeatSetting)) As IList(Of Integer)
| Type | Name | Description |
|---|---|---|
| IWorksheet | worksheet | The worksheet whose pagination information is retrieved. Must not be |
| PaginationOrientation | orientation | The pagination direction that determines whether row or column boundary indexes are returned. |
| IList<IRange> | keepTogetherRanges | The ranges that should remain on the same page. Can be |
| IList<RepeatSetting> | repeatSettings | The repeat settings applied during pagination. Can be |
| Type | Description |
|---|---|
| IList<int> | A list of row or column indexes that represent the page boundaries for the specified orientation, or |
worksheet.PageSetup.PrintArea = "A1:D80";
worksheet.Range["A1:D80"].Value = 100;
List<IRange> keepTogetherRanges = new List<IRange>();
keepTogetherRanges.Add(worksheet.Range["A20:D25"]);
RepeatSetting repeatSetting = new RepeatSetting();
repeatSetting.Range = worksheet.Range["A1:D80"];
repeatSetting.TitleRowStart = 0;
repeatSetting.TitleRowEnd = 0;
List<RepeatSetting> repeatSettings = new List<RepeatSetting>();
repeatSettings.Add(repeatSetting);
PrintManager printManager = new PrintManager();
IList<int> pageBoundaries = printManager.GetPaginationInfo(
worksheet, PaginationOrientation.Vertical, keepTogetherRanges, repeatSettings);
| Type | Condition |
|---|---|
| InvalidOperationException | if the keep-together or repeat settings cannot fit within the printable page area. |