Page 1 of 1

Issue with AutoWidthCol and Userformat

Posted: Fri Jul 12, 2013 1:43 pm
by ich947
The autosizing of columns with an userformat does not work correctly.

Our column-format looks like this: '0.00%'
We are setting the format via CmdFormat.Number.Format or with SetFloatValue(...)

But the AutoWidthCol-function does not respect our userformat.
Because of this, the calculated width is to small to fit the values with our numberformat.

I´ve found out, that the GetAsFmtString-function, which is used in .AutoWidthCol, returns for example '1' instead of '100.00%'.

I think the origin of that error is in TExcelMask.SetMask(Value).
"Value" contains our number-format ('0.00%').
At the beginning of the function the Value-parameter gets cleaned up. (It removes some special characters)
But after that the Value gets never used.
The "clean-up" is followed by this line:

Code: Select all

FMask := '@'; // Value;
I´m irritated why Value is commented out. And I have no idea what '@' means.
If I replace that '@' with "Value" the autosizing works.
Now GetAsFmtString returns the correct value ('100.00%').


Can you please check that issue?

Re: Issue with AutoWidthCol and Userformat

Posted: Wed Jul 31, 2013 8:28 am
by larsa
Hello

Sorry, FMask := @; was for debugging... This is corrected now.