Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
According to the definition, a page break is a place in a flow of text where one page ends and the next begins. Microsoft Excel lets users add page breaks into any selected cell of a worksheet.
When the page break is added at a cell, the page ends at that point and the data after the page break is printed on the next page while printing. In simple words, page breaks divide your worksheet into multiple pages according to your specifications. You can also add page breaks to your worksheets at runtime using Aspose.Cells for Python via .NET. Aspose.Cells for Python via .NET allows developers to add two kinds of page breaks:
In the rest of the discussion, we will describe how you can add horizontal or vertical page breaks into your worksheets using Aspose.Cells for Python via .NET.
Aspose.Cells for Python via .NET provides a Workbook class that represents an Excel file. The Workbook class contains a Worksheets collection that allows access to each worksheet in the Excel file.
A worksheet is represented by the Worksheet class. The Worksheet class provides a wide range of properties and methods used to manage a worksheet.
To add the page breaks, use the Worksheet class’s horizontal_page_breaks and vertical_page_breaks properties.
The horizontal_page_breaks and vertical_page_breaks properties are collections that may contain several page breaks. Each collection contains several methods for managing horizontal and vertical page breaks.
To add a page break in a worksheet, insert vertical and horizontal page breaks at the specified cell by calling the HorizontalPageBreakCollection.add() and VerticalPageBreakCollection.add() methods. Each add method takes the name of the cell where the break should be added.
When you set FitToPages properties (that is fit_to_pages_tall and fit_to_pages_wide) in page setup settings, the page break settings are affected, so if you print the worksheet, the page break settings are not considered even though they are still set.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.