[]
Generates pagination information for all worksheets in all workbooks.
This method paginates each workbook in the specified list by calling Paginate(IWorkbook), combines the resulting PageInfo objects into a single list, and then updates the page number and page settings for the combined pages.
public IList<PageInfo> Paginate(IEnumerable<IWorkbook> workbooks)
Public Function Paginate(workbooks As IEnumerable(Of IWorkbook)) As IList(Of PageInfo)
| Type | Name | Description |
|---|---|---|
| IEnumerable<IWorkbook> | workbooks | The workbooks to paginate. The workbooks are processed in the order they appear in the list. |
| Type | Description |
|---|---|
| IList<PageInfo> | A list of PageInfo objects generated from all workbooks. Returns an empty list if the specified list is empty. |
worksheet.PageSetup.PrintArea = "B2:D6";
worksheet.Range["B2:D6"].Value = "Test";
List<IWorkbook> workbooks = new List<IWorkbook>();
workbooks.Add(workbook);
PrintManager printManager = new PrintManager();
IList<PageInfo> pages = printManager.Paginate(workbooks);
Generate pagination informations for all worksheets in the workbook.
public IList<PageInfo> Paginate(IWorkbook workbook)
Public Function Paginate(workbook As IWorkbook) As IList(Of PageInfo)
| Type | Name | Description |
|---|---|---|
| IWorkbook | workbook | The workbook object. |
| Type | Description |
|---|---|
| IList<PageInfo> | A list of PageInfo objects for all visible worksheets in the workbook. Returns an empty list if no pages are generated. |
worksheet.PageSetup.PrintArea = "A1:B4";
worksheet.Range["A1:B4"].Value = new object[,]
{
{ "Name", "Value" },
{ "A", 100 },
{ "B", 200 },
{ "C", 300 }
};
PrintManager printManager = new PrintManager();
IList<PageInfo> pages = printManager.Paginate(workbook);
Generate pagination information for the worksheet.
public IList<PageInfo> Paginate(IWorksheet worksheet)
Public Function Paginate(worksheet As IWorksheet) As IList(Of PageInfo)
| Type | Name | Description |
|---|---|---|
| IWorksheet | worksheet | The worksheet object. |
| Type | Description |
|---|---|
| IList<PageInfo> | A list of PageInfo objects that describe the generated pages in page order. Returns an empty list if no printable pages are generated. |
worksheet.PageSetup.PrintArea = "A1:B4";
worksheet.Range["A1:B4"].Value = new object[,]
{
{ "Name", "Value" },
{ "A", 100 },
{ "B", 200 },
{ "C", 300 }
};
PrintManager printManager = new PrintManager();
IList<PageInfo> pages = printManager.Paginate(worksheet);
Generate pagination information for the worksheet.
public IList<PageInfo> Paginate(IWorksheet worksheet, IList<IRange> keepTogetherRanges, IList<RepeatSetting> repeatSettings)
Public Function Paginate(worksheet As IWorksheet, keepTogetherRanges As IList(Of IRange), repeatSettings As IList(Of RepeatSetting)) As IList(Of PageInfo)
| Type | Name | Description |
|---|---|---|
| IWorksheet | worksheet | The worksheet object. |
| IList<IRange> | keepTogetherRanges | The collection of ranges that need to keep together. |
| IList<RepeatSetting> | repeatSettings | The collection of repeat settings for a Range. |
| Type | Description |
|---|---|
| IList<PageInfo> |
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<PageInfo> pages = printManager.Paginate(worksheet, keepTogetherRanges, repeatSettings);
Generate pagination information for the range.
public IList<PageInfo> Paginate(IRange printArea)
Public Function Paginate(printArea As IRange) As IList(Of PageInfo)
| Type | Name | Description |
|---|---|---|
| IRange | printArea | The area will be paginated. |
| Type | Description |
|---|---|
| IList<PageInfo> | A list of PageInfo objects that describe the generated pages for the specified range in page order. Returns an empty list if no printable pages are generated. |