We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

AutofitColumns() does not work

Thread ID:





68185 Sep 11,2007 10:25 AM Dec 26,2007 04:18 AM Windows Forms 5
Tags: XlsIO
Christian Nein
Asked On September 11, 2007 10:25 AM


in the attached file "DeltaMaster Report.xls", which was generated by XlsIO, I did not find a way to autosize the 4th column "D", which is containing some special fonts. I tried following things:
1) Autosizing the whole column by worksheet.AutofitColumn(3);
2) Autosizing the single cells by range.EntireColumn.AutofitColumns();
3) Autosizing the range containing the data (D9:D16) by range.EntireColumn.AutofitColumns();

The result is always the same: AutofitColumns() takes no effect and the column stays too wide.

How can I get the autosizing working?

Note: the fonts (*.ttf) also attached in the Zip-archive have to be installed to display the SparkLines in column "D" properly.

Thanks in advance & best regards


Christian Nein
Replied On September 19, 2007 12:23 PM


could anybody of the support team please give a statement to this issue?

Thanks in advance & best regards

Rajarajeswari S [Syncfusion]
Replied On September 25, 2007 01:50 AM


I am not able to see the issue of AutoSize property as you said. Please refer the sample from the below link
an .xls file is created like "DeltaMaster Report.xls" and Autsize property is set to the sheet range from D8 to D16 works fine here,

Please refer the below code snippet which illustrates the above,



Please let me know if this helps you,

The AutoSize property is not working only with the template which you have send, it works fine in others, So please send the sample of yours to work further on this.


Christian Nein
Replied On October 9, 2007 05:18 AM


we have upgraded to version but the error still occurs. In the attached XLS-file, the ranges

have been autosized by:

IRange range = null;
range = worksheet.Range[row1, col1, row2, col2];

In the attached XLS-file you can see that the AutofitColumns() call took no effect. In my opinion this might have to do with the special fonts (Spark fonts) we are using (see attachment of my first posting). In your example, you only use default fonts. It could also have to do with the merged cells - I don't know.

For testing, please use the XLS-file I have attached to this posting. But you will have to install the Spark fonts I attached to my first posting to view the file properly. I also attached a screenshot of how the XLS-file looks like on my computer.

I am looking forward to your answer.

Thanks in advance & best regards

DeltaMaster Report 25.zip

Rajarajeswari S [Syncfusion]
Replied On December 25, 2007 11:08 PM

Hi Christian,

Thanks for using Syncfusion products.

Your direct trac incident ID 37615 has been updated, please follow up with that incident.


Rajarajeswari S [Syncfusion]
Replied On December 26, 2007 04:18 AM

Hi Christian,

We are glad to inform you that the issue of AutoFitColumn method does not work and the file cant be opened properly has been fixed in our latest beta version You can download this version from the below forum thread:


Please try this and let me know if this helps.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.