FlexCel Studio for VCL/LCL
ContentsIndex
PreviousUpNext
TFlexCelImport.AutofitRowsOnWorkbook Method

Autofits all rhe 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 believe is best. You can change this behaviour specifying keepSizesAutomatic = false.

Pascal
procedure AutofitRowsOnWorkbook(const AutofitNotAutofittingRows: Boolean; const KeepSizesAutomatic: Boolean; const Adjustment: extended);
C++
__fastcall AutofitRowsOnWorkbook(const Boolean AutofitNotAutofittingRows, const Boolean KeepSizesAutomatic, const extended Adjustment);
Parameters 
Description 
const 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. 
const 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.  
const Adjustment: extended 
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. 
Copyright (c) 2002-2008 TMS Software. All rights reserved.
What do you think about this topic? Send feedback!