Field-Map Scripting

4.6.4.4 SetPrintMargins

SetPrintMargins procedure


Prototype:

procedure SetPrintMargins(const Left_mm,Top_mm,Right_mm,Bottom_mm,Header_mm,Footer_mm :double);

Description:

Sets the margins on the active sheet.

Syntax:

xls.SetPrintMargins(Left_mm,Top_mm,Right_mm,Bottom_mm,Header_mm,Footer_mm);  


Part

Description


xls

Variable declared as an instance of the TExcelWrapper class


Left_mm, Top_mm, Right_mm, Bottom_mm

Variables declared as integer that represent custom page margins in mm


Header_mm, Footer_mm

Variables declared as integer that represent custom header or footer margins in mm

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.