Field-Map Scripting

4.6.4.3 SetPrintArea

SetPrintArea procedure


Prototype:

procedure SetPrintArea(const row1,col1,row2,col2 :integer);

Description:

Sets a print area. Print area is a range of cells that is designated to be printed.

Syntax:

xls.SetPrintArea(row1,col1,row2,col2);  


Part

Description


xls

Variable declared as an instance of the TExcelWrapper class


Row1

Variable declared as integer that represents row number of the first cell in the range


Col1

Variable declared as integer that represents column number of the first cell in the range


Row2

Variable declared as integer that represents row number of the last cell in the range


Col2

Variable declared as integer that represents column number of the last cell in the range

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.