Search Results for

    Show / Hide Table of Contents

    ExcelFile.AutofitRow Method

    Overloads

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

    ExcelFile.AutofitRow(Int32, Boolean, Double)

    Autofits a row so it adapts its height to show all the text inside. It does not matter if the row is set to Autofit or not in Excel. Note that due to GDI+ / GDI incompatibilities, the height calculated by FlexCel will not be exactly the same than the one calculated by Excel. So when you open this workbook in Excel, Excel will re calculate the row heights to what it believes is best. You can change this behavior specifying keepHeightAutomatic = false. See also Fine Tuning Row Autofitting

    Syntax

    Namespace: FlexCel.Core

    public void AutofitRow(Int32 row, Boolean keepHeightAutomatic, Double adjustment)

    Parameters

    <-> Parameter Type Description
    row Int32 Row to Autofit.
    keepHeightAutomatic Boolean If true, rows will be still autoheight when you open the file in Excel, so Excel will recalculate the values, probably changing the page breaks. If you set it to false, rows will be fixed in size, and when you open it on Excel they will remain so.
    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 rows will be adjusted to 110% percent of what their calculated height was.
    Use this parameter to fine-tune autofiting, if for example rows are too small when opening the file in Excel.

    See also

    • ExcelFile

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

    Autofits a range of rows so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the height calculated by FlexCel will not be exactly the same than the one calculated by Excel. So when you open this workbook in Excel, Excel will re calculate the row heights to what it believes is best. You can change this behavior specifying keepHeightAutomatic = false. See also Fine Tuning Row Autofitting

    Syntax

    Namespace: FlexCel.Core

    public void AutofitRow(Int32 row1, Int32 row2, Boolean autofitNotAutofittingRows, Boolean keepHeightAutomatic, Double adjustment)

    Parameters

    <-> Parameter Type Description
    row1 Int32 First row to autofit.
    row2 Int32 Last row to autofit.
    autofitNotAutofittingRows Boolean When you are autofitting a range of rows, some rows might not be set to Autofit in Excel. When this parameter is true, those rows will be autofitted anyway.
    keepHeightAutomatic Boolean If true, rows will be still autoheight when you open the file in Excel, so Excel will recalculate the values, probably changing the page breaks. If you set it to false, rows will be fixed in size, and when you open it on Excel they will remain so.
    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 rows will be adjusted to 110% percent of what their calculated height was.
    Use this parameter to fine-tune autofiting, if for example rows are too small when opening the file in Excel.

    See also

    • ExcelFile

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

    Autofits a range of rows so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the height calculated by FlexCel will not be exactly the same than the one calculated by Excel. So when you open this workbook in Excel, Excel will re calculate the row heights to what it believes is best. You can change this behavior specifying keepHeightAutomatic = false. See also Fine Tuning Row Autofitting

    Syntax

    Namespace: FlexCel.Core

    public void AutofitRow(Int32 row1, Int32 row2, Boolean autofitNotAutofittingRows, Boolean keepHeightAutomatic, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight)

    Parameters

    <-> Parameter Type Description
    row1 Int32 First row to autofit.
    row2 Int32 Last row to autofit.
    autofitNotAutofittingRows Boolean When you are autofitting a range of rows, some rows might not be set to Autofit in Excel. When this parameter is true, those rows will be autofitted anyway.
    keepHeightAutomatic Boolean If true, rows will be still autoheight when you open the file in Excel, so Excel will recalculate the values, probably changing the page breaks. If you set it to false, rows will be fixed in size, and when you open it on Excel they will remain so.
    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 rows will be adjusted to 110% percent of what their calculated height was.
    Use this parameter to fine-tune autofitting, if for example rows 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 row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the row and not a percentage. The final size of the row will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
    minHeight Int32 Minimum final height for the row to autofit. If the calculated value is less than minHeight, row size will be set to minHeight.

    A negative value on minHeight means the row size will be no smaller than the original height.
    maxHeight Int32 Maximum final height for the row to autofit. If the calculated value is more than maxHeight, row size will be set to maxHeight.

    maxHeight = 0 means no maxHeight.

    A negative value on maxHeight means the row size will be no bigger than the original height.

    See also

    • ExcelFile

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

    Autofits a range of rows so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the height calculated by FlexCel will not be exactly the same than the one calculated by Excel. So when you open this workbook in Excel, Excel will re calculate the row heights to what it believes is best. You can change this behavior specifying keepHeightAutomatic = false. See also Fine Tuning Row Autofitting

    Syntax

    Namespace: FlexCel.Core

    public void AutofitRow(Int32 row1, Int32 row2, Boolean autofitNotAutofittingRows, Boolean keepHeightAutomatic, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight, TAutofitMerged autofitMerged)

    Parameters

    <-> Parameter Type Description
    row1 Int32 First row to autofit.
    row2 Int32 Last row to autofit.
    autofitNotAutofittingRows Boolean When you are autofitting a range of rows, some rows might not be set to Autofit in Excel. When this parameter is true, those rows will be autofitted anyway.
    keepHeightAutomatic Boolean If true, rows will be still autoheight when you open the file in Excel, so Excel will recalculate the values, probably changing the page breaks. If you set it to false, rows will be fixed in size, and when you open it on Excel they will remain so.
    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 rows will be adjusted to 110% percent of what their calculated height was.
    Use this parameter to fine-tune autofiting, if for example rows 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 row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the row and not a percentage. The final size of the row will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
    minHeight Int32 Minimum final height for the row to autofit. If the calculated value is less than minHeight, row size will be set to minHeight.

    A negative value on minHeight means the row size will be no smaller than the original height.
    maxHeight Int32 Maximum final height for the row to autofit. If the calculated value is more than maxHeight, row size will be set to maxHeight.

    maxHeight = 0 means no maxHeight.

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

    See also

    • ExcelFile

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

    Autofits a range of rows so they adapt their height to show all the text inside. Note that due to GDI+ / GDI incompatibilities, the height calculated by FlexCel will not be exactly the same than the one calculated by Excel. So when you open this workbook in Excel, Excel will re calculate the row heights to what it believes is best. You can change this behavior specifying keepHeightAutomatic = false. See also Fine Tuning Row Autofitting

    Syntax

    Namespace: FlexCel.Core

    public abstract void AutofitRow(Int32 row1, Int32 row2, Int32 minCol, Int32 maxCol, Boolean autofitNotAutofittingRows, Boolean keepHeightAutomatic, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight, TAutofitMerged autofitMerged)

    Parameters

    <-> Parameter Type Description
    row1 Int32 First row to autofit.
    row2 Int32 Last row to autofit.
    minCol Int32 First column that will be used to calculate the height of the row. If for example you wanted to calculate the row height based in the contents of the columns 3 to 9, you would specify 3 here.
    maxCol Int32 Last column that will be used to calculate the height of the row. If for example you wanted to calculate the row height based in the contents of the columns 3 to 9, you would specify 9 here.

    Specify any value <=0 here to use all columns for the autofit.
    autofitNotAutofittingRows Boolean When you are autofitting a range of rows, some rows might not be set to Autofit in Excel. When this parameter is true, those rows will be autofitted anyway.
    keepHeightAutomatic Boolean If true, rows will be still autoheight when you open the file in Excel, so Excel will recalculate the values, probably changing the page breaks. If you set it to false, rows will be fixed in size, and when you open it on Excel they will remain so.
    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 rows will be adjusted to 110% percent of what their calculated height was.
    Use this parameter to fine-tune autofiting, if for example rows 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 row will be made larger by that amount from the calculated autofit. Different from the "adjustment" parameter, this parameter adds a fixed size to the row and not a percentage. The final size of the row will be: FinalSize = CalulatedAutoFit * adjustment + adjusmentFixed
    minHeight Int32 Minimum final height for the row to autofit. If the calculated value is less than minHeight, row size will be set to minHeight.

    A negative value on minHeight means the row size will be no smaller than the original height.
    maxHeight Int32 Maximum final height for the row to autofit. If the calculated value is more than maxHeight, row size will be set to maxHeight.

    maxHeight = 0 means no maxHeight.

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

    See also

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