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 not working, included example attachment

Hi,

Autofitcolumn goes wrong on columns including a formula.

Nothing strange happens in the example, just a SUM(range) formula on a couple of rows.

XlsIO refuses to autofit the formula Column

I included a sample based on the sample in this thread:
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=63522

If the autofit is not working propery, is there any work-around for manually calculating and setting the widths?

Thanks

TestSample.zip

6 Replies

AN Anonymous October 24, 2007 08:21 AM UTC

XlsIO doesn't evaluate formula values, so if you want XlsIO to autofit formula value correctly, you should try to set
IRange.FormulaNumberValue or IRange.FormulaStringValue and then XlsIO should use one of those values to evaluate cell dimensions.


BV Bert Vanpeteghem October 24, 2007 08:27 AM UTC

Ok, thanks for the reply.

2 questions:

- In the sample, when calling FormulaNumberValue or FormulaStringValue on the Formula Range, the return 0.0 and NULL. What's my problem there?

- Can you give some pointers on how to calculate the width based on the value in the cell?

Thanks



BV Bert Vanpeteghem October 24, 2007 08:33 AM UTC

Ignore my previous post. Problem solved

>Ok, thanks for the reply.

2 questions:

- In the sample, when calling FormulaNumberValue or FormulaStringValue on the Formula Range, the return 0.0 and NULL. What's my problem there?

- Can you give some pointers on how to calculate the width based on the value in the cell?

Thanks



BV Bert Vanpeteghem October 24, 2007 02:00 PM UTC

Problem not solved: I narrowed it down to bold columns. If I set all as non-bold, it all fits perfectly.

See example in attachmen

TestSample.zip


BV Bert Vanpeteghem October 24, 2007 02:21 PM UTC

Correction: Combination of bold and formula column.

This sample: http://websamples.syncfusion.com/samples/XlsIO.Windows/F63522_1/main.htm

only shows that bold works


AN Anonymous October 25, 2007 01:01 PM UTC

I have tried your sample, all values seems to be visible.
Which cell (cells) wasn't autofitted good enough?

Loader.
Live Chat Icon For mobile
Up arrow icon