Field-Map Scripting

4.6.3.5 DrawBorders

DrawBorders procedure


Prototype:

procedure DrawBorders(const row1,col1,row2,col2 :integer; const Borders,BorderStyle :string);

Description:

Defines borders of a range of cells.

Syntax:

xls.DrawBorders(row1,col1,row2,col2, Borders, BorderStyle);  


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


Borders

Variable declared as string that defines which parts of the borders will be applied. The value can be set to one of the following constants:

LEFT,RIGHT,TOP,BOTTOM


BorderStyle

Variable declared as string that represents border style. The value can be set to one of the following constants:

HAIR,THIN,MEDIUM,THICK,DOUBLE

Return value:

none

See also:

MergeCells , SetTextOrientation , Align , DrawBorders , FormatCells , AddUserFormat , AutofitCol , AutofitRow , SetOptimalColWidth , SetColWidth ,SetDefaultColWidth,SetRowHeight, SetDefaultRowHeight , SetColWidth_mm , SetRowHeight_mm , GetTextWidth , GetTextHeight , GetCellWidth, Complex example


Example:

Var
  Row, Rows, Cols:integer;
  xls :TExcelWrapper;
Begin
  {document preparation}
  //...
  {managing worksheets}
  //...
  
  {------------------Formats-------------------}
  xls.AddUserFormat('Title_h1',14,'BOLD','0,0,0',0,0,'CENTER','CENTER',false);       
  xls.AddUserFormat('Title_h2',12,'','0,0,0',0,0,'CENTER','CENTER',false);
  
  {setting default cloumn width abd height}
  xls.SetDefaultColWidth(3500);
  xls.SetDefaultRowHeight(15);
  
  {setting cell values}
  //...  
  
  {formatting cells examples}
  xls.MergeCells(Row,1,Row,Cols);
  xls.DrawBorders(Row,1,Row,Cols,'BOTTOM','THIN');
  xls.SetTextOrientation(Row,1,Row,Cols,45);
  xls.FillColor(Row,1,Row,Cols,clOceanGreen); 
     
  xls.FormatCells(Row+1,1,Row+1,Cols,'BOLD',2,true,'RIGHT','CENTER');
  
  xls.Align(Row+3,1,Row+3,Cols,'LEFT','CENTER');

  {document saving / previewing}
  //...
End.