Hi!
Hi,
Hi!
Sample code:
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[ 0 ];
int row = 0;
int column = 2;
Cells cells = worksheet.Cells;
cells.SetColumnWidthPixel( 2, 270 );
Cell cell = cells[ row, column ];
// when IndentLevel == 0 this text need 2 rows to display
// when IndentLevel == 3 this text need 3 rows to display
cell.PutValue( "11111111111111111111111111111 1 1 11111111111111111111111111111 1 1" );
Style style = cell.GetStyle();
style.IsTextWrapped = true;
style.IndentLevel = 3;
style.Font.Name = "Courier New";
style.Font.Size = 8;
cell.SetStyle( style );
worksheet.AutoFitRow( row );
double incorrectHeight1 = worksheet.Cells.GetRowHeight( row );
// must be 33.75 but actually is 22.5
workbook.Save( "BookWithIncorrectHeight1.xlsx" );
worksheet.AutoFitRow( row, column, column );
double incorrectHeight2 = worksheet.Cells.GetRowHeight( row );
// must be 33.75 but actually is 22.5
workbook.Save( "BookWithIncorrectHeight2.xlsx" );
style = cell.GetStyle();
style.IndentLevel = 0;
cell.SetStyle( style );
worksheet.AutoFitRow( row );
double correctHeight1 = worksheet.Cells.GetRowHeight( row );
// must be 22.5 and actually is 22.5
workbook.Save( "BookWithCorrectHeight1.xlsx" );
worksheet.AutoFitRow( row, column, column );
double correctHeight2 = worksheet.Cells.GetRowHeight( row );
// must be 22.5 and actually is 22.5
workbook.Save( "BookWithCorrectHeight2.xlsx" );
Hi,
After further evaluation of your issue, actually we do not support IndentLevel in the AutoFitRow currently because we could not get the width of indent level, in the unit of pixels.
After looking into this feature, we find the width of indent depends on standard font (e.g Tools->General-> Standard Font, in MS Excel 2003), but we still could not evaluate and do not know how the standard font works. Your issue is still open, if we have any update in near future, we will update you here immediately.
Thank you.
Thank You!
The issues you have found earlier (filed as CELLSNET-40340) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.