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. Image for the cookie policy date

AutofitColumns() does not work

Hi,

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

ExampleAndFonts.zip

5 Replies

CN Christian Nein September 19, 2007 04:23 PM UTC

Hello,

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

Thanks in advance & best regards
Christian


RS Rajarajeswari S Syncfusion Team September 25, 2007 05:50 AM UTC



Hi,

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,

sheet.Range["D8:D16"].AutofitColumns();

http://websamples.syncfusion.com/samples/XlsIO.Windows/F68248/main.htm

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.

Regards,
S.Rajarajeswari


CN Christian Nein October 9, 2007 09:18 AM UTC

Hi,

we have upgraded to version 5.2.0.25 but the error still occurs. In the attached XLS-file, the ranges
B9:B16
D9:D16
F9:F16

have been autosized by:

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

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
Christian

DeltaMaster Report 25.zip


RS Rajarajeswari S Syncfusion Team December 26, 2007 04:08 AM UTC



Hi Christian,

Thanks for using Syncfusion products.

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

Regards,
Raji



RS Rajarajeswari S Syncfusion Team December 26, 2007 09:18 AM UTC


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 6.1.0.23. You can download this version from the below forum thread:

http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=69997

Please try this and let me know if this helps.

Thanks,
Raji


Loader.
Live Chat Icon For mobile
Up arrow icon