Search Results for

    Show / Hide Table of Contents

    ExcelFile.AutofitCol Method

    Overloads

    • ExcelFile.AutofitCol(Int32, Boolean, Double)
    • ExcelFile.AutofitCol(Int32, Int32, Boolean, Double)
    • ExcelFile.AutofitCol(Int32, Int32, Boolean, Double, Int32, Int32, Int32)
    • ExcelFile.AutofitCol(Int32, Int32, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)
    • ExcelFile.AutofitCol(Int32, Int32, Int32, Int32, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)

    ExcelFile.AutofitCol(Int32, Boolean, Double)

    Autofits a column so it adapts its width to show all the text inside.

    Syntax

    Namespace: FlexCel.Core

    public void AutofitCol(Int32 col, Boolean ignoreStrings, Double adjustment)

    Parameters

    <-> Parameter Type Description
    col Int32 Column to Autofit.
    ignoreStrings Boolean When true, strings will not be considered for the autofit. Only numbers will.
    adjustment Double You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements.
    If you set it to for example 1.1, then columns will be adjusted to 110% percent of what their calculated width was.
    Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.

    See also

    • ExcelFile

    ExcelFile.AutofitCol(Int32, Int32, Boolean, Double)

    Autofits a range of columns so they adapt their width to show all the text inside.

    Syntax

    Namespace: FlexCel.Core

    public void AutofitCol(Int32 col1, Int32 col2, Boolean ignoreStrings, Double adjustment)

    Parameters

    <-> Parameter Type Description
    col1 Int32 First column to Autofit.
    col2 Int32 Last column to Autofit.
    ignoreStrings Boolean When true, strings will not be considered for the autofit. Only numbers will.
    adjustment Double You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements.
    If you set it to for example 1.1, then columns will be adjusted to 110% percent of what their calculated width was.
    Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.

    See also

    • ExcelFile

    ExcelFile.AutofitCol(Int32, Int32, Boolean, Double, Int32, Int32, Int32)

    Autofits a range of columns so they adapt their width to show all the text inside.

    Syntax

    Namespace: FlexCel.Core

    public void AutofitCol(Int32 col1, Int32 col2, Boolean ignoreStrings, Double adjustment, Int32 adjustmentFixed, Int32 minWidth, Int32 maxWidth)

    Parameters

    <-> Parameter Type Description
    col1 Int32 First column to Autofit.
    col2 Int32 Last column to Autofit.
    ignoreStrings Boolean When true, strings will not be considered for the autofit. Only numbers will.
    adjustment Double You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements.
    If you set it to for example 1.1, then columns will be adjusted to 110% percent of what their calculated width was.
    Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.
    adjustmentFixed Int32 You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the column will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the column and not a percentage. The final size of the column will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
    minWidth Int32 Minimum final width for the column to autofit. If the calculated value is less than minWidth, column size will be set to minWidth.

    A negative value on minWidth means the column size will be no smaller than the original width.
    maxWidth Int32 Maximum final width for the column to autofit. If the calculated value is more than maxWidth, column size will be set to maxWidth.

    maxWidth = 0 means no maxWidth.

    A negative value on maxWidth means the column size will be no bigger than the original width.

    See also

    • ExcelFile

    ExcelFile.AutofitCol(Int32, Int32, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)

    Autofits a range of columns so they adapt their width to show all the text inside.

    Syntax

    Namespace: FlexCel.Core

    public void AutofitCol(Int32 col1, Int32 col2, Boolean ignoreStrings, Double adjustment, Int32 adjustmentFixed, Int32 minWidth, Int32 maxWidth, TAutofitMerged autofitMerged)

    Parameters

    <-> Parameter Type Description
    col1 Int32 First column to Autofit.
    col2 Int32 Last column to Autofit.
    ignoreStrings Boolean When true, strings will not be considered for the autofit. Only numbers will.
    adjustment Double You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements.
    If you set it to for example 1.1, then columns will be adjusted to 110% percent of what their calculated width was.
    Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.
    adjustmentFixed Int32 You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the column will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the column and not a percentage. The final size of the column will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
    minWidth Int32 Minimum final width for the column to autofit. If the calculated value is less than minWidth, column size will be set to minWidth.

    A negative value on minWidth means the column size will be no smaller than the original width.
    maxWidth Int32 Maximum final width for the column to autofit. If the calculated value is more than maxWidth, column size will be set to maxWidth.

    maxWidth = 0 means no maxWidth.

    A negative value on maxWidth means the column size will be no bigger than the original width.
    autofitMerged TAutofitMerged Specifies which column in a merged cell using more than one column will be used to autofit the merged cell.
    If you don't specify this parameter, it will be the last column.

    See also

    • ExcelFile

    ExcelFile.AutofitCol(Int32, Int32, Int32, Int32, Boolean, Double, Int32, Int32, Int32, TAutofitMerged)

    Autofits a range of columns so they adapt their width to show all the text inside.

    Syntax

    Namespace: FlexCel.Core

    public abstract void AutofitCol(Int32 col1, Int32 col2, Int32 minRow, Int32 maxRow, Boolean ignoreStrings, Double adjustment, Int32 adjustmentFixed, Int32 minWidth, Int32 maxWidth, TAutofitMerged autofitMerged)

    Parameters

    <-> Parameter Type Description
    col1 Int32 First column to Autofit.
    col2 Int32 Last column to Autofit.
    minRow Int32 First row that will be used to autofit the column. If you want for example to autofit a column based only in the cells from row 3 to 10, you would use 3 as minRow.
    maxRow Int32 Last row that will be used to autofit the column. If you want for example to autofit a column based only in the cells from row 3 to 10, you would use 10 as maxRow.

    Specify any value <=0 here to use all rows for the autofit.
    ignoreStrings Boolean When true, strings will not be considered for the autofit. Only numbers will.
    adjustment Double You will normally want to set this parameter to 1, which means that autofit will be made with standard measurements.
    If you set it to for example 1.1, then columns will be adjusted to 110% percent of what their calculated width was.
    Use this parameter to fine-tune autofiting, if for example columns are too small when opening the file in Excel.
    adjustmentFixed Int32 You will normally set this parameter to 0, which means standard autofit. If you set it to a value, the column will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the column and not a percentage. The final size of the column will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
    minWidth Int32 Minimum final width for the column to autofit. If the calculated value is less than minWidth, column size will be set to minWidth.

    A negative value on minWidth means the column size will be no smaller than the original width.
    maxWidth Int32 Maximum final width for the column to autofit. If the calculated value is more than maxWidth, column size will be set to maxWidth.

    maxWidth = 0 means no maxWidth.

    A negative value on maxWidth means the column size will be no bigger than the original width.
    autofitMerged TAutofitMerged Specifies which column in a merged cell using more than one column will be used to autofit the merged cell.
    If you don't specify this parameter, it will be the last column.

    See also

    • ExcelFile
    In This Article
    Back to top FlexCel Studio for the .NET Framework v7.24.0.0
    © 2002 - 2025 tmssoftware.com