Page 1 of 1

Three Problems with 5.10.05

Posted: Wed Mar 13, 2013 11:04 pm
by pl00
1. Freezing top rows causes those rows to be displayed twice when the resulting spreadsheet is opened. Scrolling the sheet resolves the issue. If the spreadsheet is saved after the scrolling, it displays correctly on subsequent opens.

2. AutowidthCols doesn't work propery if cells contain non default formatting. The two I've tested are "$"#,##0.00 for floats and dd mmm yyyy for DateTime. The columns aren't wide enough to display the values.

3. Creating and using a DefaultFormat which includes a date structure (eg dd mmm yyyy) doesn't work and it corrupts the value being entered into the cell (the resultant cell value appears to be the Index of the selected format).

2 & 3 can be worked around, but 1 is a bit of an issue for me.

Re: Three Problems with 5.10.05

Posted: Mon Mar 18, 2013 12:44 pm
by larsa
Hello

1. I don't know how you have created the frozen panes, but in the latest update there is a new method for easier create frozen panes: XLS[sheet].FreezePanes(Col,Row)

2,3 This is fixed in update 5.10.06

Re: Three Problems with 5.10.05

Posted: Mon Mar 18, 2013 2:51 pm
by pl00
Thanks for the fixes - most of the issues are resolved. However, I still have a problem with formatting dates.

I use:

FXLS.CmdFormat.BeginEdit(Nil);
FXLS.CmdFormat.Number.Format := 'dd mmm yyyy';
FXLS.CmdFormat.Alignment.Horizontal := chaCenter;
FXLS.CmdFormat.AddAsDefault('FCDate');
Format_CDate := FXLS.CmdFormat.Defaults.Count-1;

to set up for Default format then

FXLS.DefaultFormat := FXLS.CmdFormat.Defaults[Format_CDate]
FXLS[Sheet].AsDateTime[Col,Row] := DateValue;
FXLS.DefaultFormat := nil;

Irresepective of the value written to the cell, the result is always 10 (which happens to be the count of the number of default formats before this format was created).

Re: Three Problems with 5.10.05

Posted: Mon Mar 18, 2013 3:53 pm
by larsa
Hello

If you changes the number format you can not use AsDateTime as this will also change the number format. There are no date/time cells in excel. A date/time cell is created by formatting a float value as a date/time value (the date float is the same as delphi TDateTime). Use AsFloat. Example:

Code: Select all

FXLS[Sheet].AsFloat[Col,Row] := DateValue;

Re: Three Problems with 5.10.05

Posted: Mon Mar 18, 2013 7:55 pm
by pl00
Thanks - that nailed it.

Re: Three Problems with 5.10.05

Posted: Tue Nov 11, 2014 4:10 pm
by maseline_98
pl00 wrote:Thanks - that nailed it.

How did you resolve the autoWidthCols? It's not seeming to work for me.

Code: Select all

   
 NUM_FORMAT = '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'; 
AutoWidthCols(0, LAST_COL);
Range.Items[DISC_COL, 0, LAST_COL, iRow].NumberFormat := NUM_FORMAT;