Field-Map Scripting

4.6.4.8 SetFirstHeaderAndFooter

SetFirstHeaderAndFooter procedure


Prototype:

procedure SetFirstHeaderAndFooter( const HeaderLeft,HeaderCenter,HeaderRight :string; const FooterLeft,FooterCenter,FooterRight :string);

Description:

Sets page header and footer on the active sheet for the first page. By default, central alignment is selected.

Special codes can be included as a part of the footer to specify options or to insert specific elements


SetHeader (and / or SetFooter and / or SetHeaderAndFooter) procedures must be used prior to using SetFirstHeaderAndFooter procedure to take effect (and set header or footer for all pages).

Syntax:

xls.SetFirstHeaderAndFooter(HeaderLeft,HeaderCenter,HeaderRight,FooterLeft,'',FooterRight);  


Part

Description


xls

Variable declared as an instance of the TExcelWrapper class


HeaderLeft, HeaderCenter, HeaderRight

Variables declared as string that contain the text for the left, center and right section of the header


FooterLeft, FooterCenter, FooterRight

Variables declared as string that contain the text for the left, center and right section of the footer

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}
  //...

  {header and footer} 
  xls.SetHeader('&L&"Calibri,Italic"&9My header');
  xls.SetFooter('&R&"Calibri,Italic"&9My footer');
  xls.SetFirstHeaderAndFooter('My first left header','','My first right header','My first left footer','','My first right footer');  

  {setting cell values}
  //...  
  
  {document saving / previewing}
  //...
End.

¨

Soo also complex header and footer example.