Page 1 of 1

Author:  amit.nayar [ Mon Jul 16, 2007 12:53 pm ]
Post subject:  Autofit

I'm using EasyXLS for C#.NET. Does it support Autofit of a column like real Excel does? I see wrap text, but no Autofit. Am I missing it somewhere?

Author:  daniela [ Tue Jul 17, 2007 2:23 am ]
Post subject: 

By default, if the row height and column width are not specified, they are automatically sized with the cell content.
If the wrap property is applied the autofit is ignored.
If somehow the column width is specified, for example after a load action (when the column widths are set), by setting the column width to -1, the column width will be automatically sized with the cell content.

Author:  amit.nayar [ Thu Jul 19, 2007 3:28 pm ]
Post subject: 

Thanks for the response, but I'm not seeing this behavior. I have some code like this:

// write huge numbers in column D
double num = 1000000000000;
int colD = 3;
for ( int row = 0; row < 10; row++ )
   num += 1;
   xlsFirstTable.easy_getCell( row, colD ).setFormat( "[$-409]#,##0.00;([$-409]#,##0.00)" );
   xlsFirstTable.easy_getCell( row, colD ).setValue( num.ToString() );

The width is not sized correctly. It comes out with #### signs when I open the document in Excel.

Page 1 of 1 All times are UTC - 4 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group