TXlsFile.SetColWidth Method
Overloads
TXlsFile.SetColWidth(Integer, Integer)
Sets the current Column width, in Excel internal units. (Character width of font 0 / 256) Note: if possible, set many column widths at once by calling TExcelFile.SetColWidth(Integer, Integer, Integer). It is faster. See Excel Internal Units for more information in Excel internal units.
Remarks
Use TExcelMetrics.ColMult to convert the internal units to pixels.
Syntax
Unit: FlexCel.XlsAdapter
procedure TXlsFile.SetColWidth(const col: Integer; const width: Integer); overload; override;
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
const | col | Integer | Column index (1 based) |
const | width | Integer | Column width, in Excel internal units. (Character width of font 0 / 256). See TExcelMetrics.ColMult |
Examples
ColWidthInPixels := xls.GetColWidth(Col) / TExcelMetrics.ColMult(xls);
See also
TXlsFile.SetColWidth(Integer, Integer, Integer)
Sets the width of a range of columns, in Excel internal units. (Character width of font 0 / 256) See Excel Internal Units for more information in Excel internal units.
Remarks
Use TExcelMetrics.ColMult to convert the internal units to pixels.
Syntax
Unit: FlexCel.XlsAdapter
procedure TXlsFile.SetColWidth(const col1: Integer; const col2: Integer; const width: Integer); overload; override;
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
const | col1 | Integer | Column index of the first column in the range. (1 based) |
const | col2 | Integer | Column index of the last column in the range. (1 based) |
const | width | Integer | Column width, in Excel internal units. (Character width of font 0 / 256). See TExcelMetrics.ColMult |
Examples
ColWidthInPixels := xls.GetColWidth(Col) / TExcelMetrics.ColMult(xls);