XlsFile.SetColWidth Method
Overloads
XlsFile.SetColWidth(Int32, Int32)
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 ExcelFile.SetColWidth(Int32, Int32, Int32). It is faster. See Excel Internal Units for more information in Excel internal units.
Remarks
Use ExcelMetrics.ColMult to convert the internal units to pixels.
Syntax
Namespace: FlexCel.XlsAdapter
public override void SetColWidth(Int32 col, Int32 width)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
col | Int32 | Column index (1 based) | |
width | Int32 | Column width, in Excel internal units. (Character width of font 0 / 256). See ExcelMetrics.ColMult |
Examples
double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);
See also
XlsFile.SetColWidth(Int32, Int32, Int32)
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 ExcelMetrics.ColMult to convert the internal units to pixels.
Syntax
Namespace: FlexCel.XlsAdapter
public override void SetColWidth(Int32 col1, Int32 col2, Int32 width)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
col1 | Int32 | Column index of the first column in the range. (1 based) | |
col2 | Int32 | Column index of the last column in the range. (1 based) | |
width | Int32 | Column width, in Excel internal units. (Character width of font 0 / 256). See ExcelMetrics.ColMult |
Examples
double ColWidthInPixels = xls.GetColWidth(Col) / ExcelMetrics.ColMult(xls);