InsertVPageBreak procedure
Prototype: |
procedure InsertVPageBreak(const col :integer; const aGoesAfter :boolean); |
|
Description: |
Inserts a Vertical Page Break at the specified column. If there is one already, it will do nothing. If the number of page breaks is bigger than the maximum Excel can admit, it will add it anyway, but you might get an exception when saving the file as xls. Exporting as images or PDF will use those additional page breaks. |
|
Syntax: |
xls.InsertVPageBreak( col, aGoesAfter); |
|
Part |
Description |
|
xls |
Variable declared as an instance of the TExcelWrapper class |
|
col |
Variable declared as integer that represents the column where to insert the page break. All column numbers are 1-based, and the breaks occur after the column. Note that col can be 0, and this would mean a page break before column 1. (which Excel will ignore) |
|
aGoesAfter |
Variable declared as boolean. It is used to add page breaks that behave as if they affected the next column, not the column to the left. |
|
Return value: |
none |
|
See also:
Landscape , SetPrintMargins , SetHeader , SetFooter , SetHeaderAndFooter , SetFirstHeaderAndFooter , SetTitleRows , SetTitleRowsAndCols , InsertHPageBreak , InsertVPageBreak , CreateHeaderOfTableContent , CreateTableOfContent , AddBackToTableOfContent , SetPrintArea , RowCount , ColCount , Header and footer codes , Predefined paper sizes, KeepColsTogether, KeepRowsTogether, AutoPageBreaks, PrintNumberOfHorizontalPages, PrintNumberOfVerticalPages, PrintToFit, Complex example
Example:
Var
Row, Rows, Cols:integer;
xls :TExcelWrapper;
Begin
{document preparation}
//...
{managing worksheets}
{setting cell values}
xls.Landscape:=true;
xls.SetPaperSize('A4');
xls.SetPrintArea(1,1,Cols, Rows);
xls.SetPrintMargins(25,25,20,25,10,10);
xls.InsertHPageBreak(10,true);
{making the sheet fit in one page of width }
xls.PrintNumberOfHorizontalPages:=1;
xls.PrintToFit:=true;
{document saving / previewing}
//...
End.
© 2024 IFER-Monitoring and Mapping Solutions