Reply to topic  [ 3 posts ] 
Autofit 
Author Message

Joined: Mon Jul 16, 2007 12:52 pm
Posts: 3
Reply with quote
Post 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?


Mon Jul 16, 2007 12:53 pm
Profile

Joined: Fri Feb 03, 2006 12:23 pm
Posts: 159
Location: Brasov, Romania
Reply with quote
Post 
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.


Tue Jul 17, 2007 2:23 am
Profile WWW

Joined: Mon Jul 16, 2007 12:52 pm
Posts: 3
Reply with quote
Post 
Thanks for the response, but I'm not seeing this behavior. I have some code like this:

Code:
// 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.


Thu Jul 19, 2007 3:28 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.