Search Results for

    Show / Hide Table of Contents

    ExcelFile.MarkRowForAutofit Method

    Overloads

    • ExcelFile.MarkRowForAutofit(Int32, Boolean, Double)
    • ExcelFile.MarkRowForAutofit(Int32, Boolean, Double, Int32, Int32, Int32, Boolean)

    ExcelFile.MarkRowForAutofit(Int32, Boolean, Double)

    Marks a row as candidate for future autofit. Note that this method will NOT change anything on the file. It just "marks" the row so you can use it later with AutofitMarkedRowsAndCols(Boolean, Boolean, Double). To change the actual autofit status on the xls file, use SetAutoRowHeight NOTE: This method will not mark empty rows.

    Remarks

    You can use this method for "delay-marking" rows that you will want to autofit later, but that you cannot autofit yet since they are not filled with data. There is normally no need to use this method, but it is used on report generation to "mark" <#row height(autofit)> tags so those rows and columns can be autofitted once the data on the sheet has been filled.

    Syntax

    Namespace: FlexCel.Core

    public void MarkRowForAutofit(Int32 row, Boolean autofit, Double adjustment)

    Parameters

    <-> Parameter Type Description
    row Int32 Row index (1 based)
    autofit Boolean Set this to true to mark the row for autofitting, false for removing the row from autofitting list.
    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.MarkRowForAutofit(Int32, Boolean, Double, Int32, Int32, Int32, Boolean)

    Marks a row as candidate for future autofit. Note that this method will NOT change anything on the file. It just "marks" the row so you can use it later with AutofitMarkedRowsAndCols(Boolean, Boolean, Double). To change the actual autofit status on the xls file, use SetAutoRowHeight NOTE: This method will not mark empty rows.

    Remarks

    You can use this method for "delay-marking" rows that you will want to autofit later, but that you cannot autofit yet since they are not filled with data. There is normally no need to use this method, but it is used on report generation to "mark" <#row height(autofit)> tags so those rows and columns can be autofitted once the data on the sheet has been filled.

    Syntax

    Namespace: FlexCel.Core

    public abstract void MarkRowForAutofit(Int32 row, Boolean autofit, Double adjustment, Int32 adjustmentFixed, Int32 minHeight, Int32 maxHeight, Boolean isMerged)

    Parameters

    <-> Parameter Type Description
    row Int32 Row index (1 based)
    autofit Boolean Set this to true to mark the row for autofitting, false for removing the row from autofitting list.
    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.
    isMerged Boolean If true, only the cell will be autofitted, not the whole row.

    See also

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