problem with 3.00.02a

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
airsoft
Posts: 13
Joined: Sun Mar 13, 2005 5:41 pm
Contact:

problem with 3.00.02a

Post by airsoft »

strange problem produced with this source :

with X do
begin
Sheets [0].Name := 'test sheet';
for I := 0 to 7 do
for J := 0 to 12 do
Sheets [0].AsFloat [I, J] := Random (10000);
with Sheets [0].Range [3, 3, 5, 5] do
begin
BorderTopStyle := cbsThin;
BorderBottomStyle := cbsThin;
BorderRightStyle := cbsThin;
BorderLeftStyle := cbsThin;
BorderInsideVertStyle := cbsThin;
BorderInsideHorizStyle := cbsThin;
end;
Filename := 'D:\PROBA.XLS';
Write;
end;

where X is class TXLSReadWriteII2

when I've opened the file with Microsoft Excel (Office XP + Service Pack 3 - 10.6809.6811) I cannot modify the formatting of these cells

D4:F6 and cells immediate to them i.e. D3:F3, D7:F7, C4:C6 and G4:G6
airsoft
Posts: 13
Joined: Sun Mar 13, 2005 5:41 pm
Contact:

Another test with 3.00.02a

Post by airsoft »

with X do
begin
Sheets [0].Name := 'test sheet';
for I := 0 to 7 do
for J := 0 to 12 do
Sheets [0].AsFloat [I, J] := Random (10000);

(* with Sheets [0].Range [3, 3, 5, 5] do
begin
// NumberFormat := '# ##0.00';
BorderTopStyle := cbsThin;
BorderBottomStyle := cbsThin;
BorderRightStyle := cbsThin;
BorderLeftStyle := cbsThin;
BorderInsideVertStyle := cbsThin;
BorderInsideHorizStyle := cbsThin;
end;*)
C := Formats.Count;
with Formats.Add do
begin
// NumberFormat := '# ##0.00';
BorderTopStyle := cbsThin;
BorderBottomStyle := cbsThin;
BorderRightStyle := cbsThin;
BorderLeftStyle := cbsThin;
end;
for I := 3 to 5 do
for J := 3 to 5 do
Sheets [0].Cell [I, J].AssignFormat (C);

Filename := 'D:\PROBA.XLS';
Write;
end;

when the formatting is made in old way i.e manual add formatting i set it to each cell, then EXCEL works fine with no problems about cell formatting
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Post by larsa »

Hello

You must set the border color as well. In the next update, there will be a default border color when the border style is set.


Lars Arvidsson
airsoft
Posts: 13
Joined: Sun Mar 13, 2005 5:41 pm
Contact:

Range property

Post by airsoft »

thanks, works fine when I set Border????Color in pair with Border????Style, it's a good idea to be set as default color: xcAutomatic or you mean the same ?
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Post by larsa »

Hello

Yes, in the next update, the color will be set to xcAutomatic as default when the border style is set.


Lars Arvidsson
Post Reply