ExcelFile.AutoPageBreaks Method
Overloads
- ExcelFile.AutoPageBreaks
- ExcelFile.AutoPageBreaks(Int32, Int32)
- ExcelFile.AutoPageBreaks(Int32, TUIRectangle)
ExcelFile.AutoPageBreaks
This method will create manual page breaks in the sheet to try to keep together the rows and columns marked with KeepRowsTogether and KeepColsTogether. It might be desirable to clear all manual page breaks (with ClearPageBreaks) before calling this method, so it has more freedom to place the new ones. If you call this method twice without removing the old page breaks, it will add the page breaks to the existing ones.
Remarks
This method is the same as calling AutoPageBreaks(20, 95)
Syntax
Namespace: FlexCel.Core
public void AutoPageBreaks()
See also
ExcelFile.AutoPageBreaks(Int32, Int32)
This method will create manual page breaks in the sheet to try to keep together the rows and columns marked with KeepRowsTogether and KeepColsTogether. It might be desirable to clear all manual page breaks (with ClearPageBreaks) before calling this method, so it has more freedom to place the new ones. If you call this method twice without removing the old page breaks, it will add the page breaks to the existing ones.
Syntax
Namespace: FlexCel.Core
public abstract void AutoPageBreaks(Int32 PercentOfUsedSheet, Int32 PageScale)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
PercentOfUsedSheet | Int32 | Percentage of the sheet that must be used in any page when fitting the rows and columns. A value of zero means that no part of the sheet must be used, so FlexCel might add a page break after a single row in a page, leaving it almost completely blank. A value of 50% means that half of the page must be used. This means that FlexCel will add a page break only if there is 50% of the current page already used. A value of 100% will do nothing, since the sheet must be completely used, and so FlexCel can never add a page break. |
|
PageScale | Int32 | This parameter must be between 50 and 100, and means how much smaller page will be considered in order to calculate the page breaks. A value of 100 means that the size used in the calculation will be the real size of the page, and while this will always work fine when exporting to PDF or exporting to images, when printing from Excel might result in a page break that is placed a little after where it should go and an empty page for certain printers. (Page size in Excel is different for different printers) Normally a value around 95 is the recommended value for this parameter. If you need to do a finer grain adjustment, you can use AutoPageBreaks(Int32, TUIRectangle). |
See also
ExcelFile.AutoPageBreaks(Int32, TUIRectangle)
This method will create manual page breaks in the sheet to try to keep together the rows and columns marked with KeepRowsTogether and KeepColsTogether. It might be desirable to clear all manual page breaks (with ClearPageBreaks) before calling this method, so it has more freedom to place the new ones. If you call this method twice without removing the old page breaks, it will add the page breaks to the existing ones.
Syntax
Namespace: FlexCel.Core
public abstract void AutoPageBreaks(Int32 PercentOfUsedSheet, TUIRectangle PageBounds)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
PercentOfUsedSheet | Int32 | Percentage of the sheet that must be used in any page when fitting the rows and columns. A value of zero means that no part of the sheet must be used, so FlexCel might add a page break after a single row in a page, leaving it almost completely blank. A value of 50% means that half of the page must be used. This means that FlexCel will add a page break only if there is 50% of the current page already used. A value of 100% will do nothing, since the sheet must be completely used, and so FlexCel can never add a page break. |
|
PageBounds | TUIRectangle | You can customize a custom page size here. If width or height of this parameter is 0, the paper size specified in the file will be used. There is normally no need to set this parameter, unless you want to fine tune the results. |