Search Results for

    Show / Hide Table of Contents

    ExcelFile.AutofitRowsOnWorkbook Method

    Overloads

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

    ExcelFile.AutofitRowsOnWorkbook(Boolean, Boolean, Double)

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

    Syntax

    Namespace: FlexCel.Core

    public void AutofitRowsOnWorkbook(Boolean autofitNotAutofittingRows, Boolean keepSizesAutomatic, Double adjustment)

    Parameters

    <-> Parameter Type Description
    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.
    keepSizesAutomatic Boolean When true, no modifications will be done to the "autofit" status of the rows. When false, all rows will be marked as "no autofit", so when you open this file in Excel it will not be resized by Excel, and the printing/export to PDF from Excel will be the same as FlexCel.
    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.AutofitRowsOnWorkbook(Boolean, Boolean, Double, Int32, Int32, Int32)

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

    Syntax

    Namespace: FlexCel.Core

    public void AutofitRowsOnWorkbook(Boolean autofitNotAutofittingRows, Boolean keepSizesAutomatic, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight)

    Parameters

    <-> Parameter Type Description
    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.
    keepSizesAutomatic Boolean When true, no modifications will be done to the "autofit" status of the rows. When false, all rows will be marked as "no autofit", so when you open this file in Excel it will not be resized by Excel, and the printing/export to PDF from Excel will be the same as FlexCel.
    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.

    See also

    • ExcelFile

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

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

    Syntax

    Namespace: FlexCel.Core

    public abstract void AutofitRowsOnWorkbook(Boolean autofitNotAutofittingRows, Boolean keepSizesAutomatic, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight, TAutofitMerged autofitMerged)

    Parameters

    <-> Parameter Type Description
    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.
    keepSizesAutomatic Boolean When true, no modifications will be done to the "autofit" status of the rows. When false, all rows will be marked as "no autofit", so when you open this file in Excel it will not be resized by Excel, and the printing/export to PDF from Excel will be the same as FlexCel.
    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