Hello,
I've figured it out that i need the following code in order to insert the column at the beginning of a sheet.
However I can not draw a border around the new column for some reason.
Any ideas?
Thanks a lot,
Eugene.
procedure TSkuListImport.MoveStatusColumn;
var vRow: integer;
begin
with FSheet do begin
Columns.AddIfNone(0, 25);
InsertColumns(0, 1);
for vRow := 4 to FRow do begin
//swap last column with the newly inserted
asString[0, vRow] := asString[25, vRow];
//wipe out the last column
asString[25, vRow] := ''
end;
Columns[0].PixelWidth := 187;
//move the heading
vRow := 0;
asString[0, vRow] := asString[1, vRow];
asString[1, vRow] := '';
with Range[0, vRow, 0, vRow] do begin
FontSize := 16;
FontStyle := [xfsBold];
FontName := 'Verdana';
end;
inc(vRow);
Range[0, vRow, 0, vRow].FillPatternForeColor := TXc12DefaultIndexColorPalette[Ord(xcGray25)];
inc(vRow);
asString[0, vRow] := asString[1, vRow];
asString[1, vRow] := '';
with Range[0, vRow, 0, vRow] do begin
FontSize := 10;
FontStyle := [xfsBold];
FontName := 'Verdana';
end;
//the following code has no effect
//add the borders
with Range[0, 4, 0, 4] do begin
BorderTopStyle := cbsMedium;
BorderBottomStyle := cbsMedium;
end;
with Range[0, 4, 0, FRow] do begin
BorderLeftStyle := cbsMedium;
BorderRightStyle := cbsThin;
end
end
end;