Page 1 of 1

Problem with saving strings

Posted: Fri Aug 26, 2011 7:44 am
by Alexaris
Hello,

I'm having a bit of a problem with saving strings to my .xls file. The problem I encountered is shown in the following code:

for x := 0 to pgrid.ColCount-1 do begin
for y := 0 to pgrid.RowCount-1 do begin
if uni then
{$IFDEF Tnt}
XLS.Sheets[1].AsWideString[x,y+1] := TTntStringGrid(StringGrid).Cells[x,y]
{$ENDIF}
else if y=0 then begin
// proc1(0,1,1,1,0,0,0,0,0,'НАЗИВ КОРИСНИКА БУЏЕТСКИХ СРЕДСТАВА'); //a procedure for formating cells(used for merging cells and formatting borders, alignment etc, the way larsa said it would work)
proc2 // a procedure that calls proc1 on several ocasions
end
...

This piece of code will write the string if instead of proc1 or proc2, I just use
XLS.Sheet[sheetIndex].AsString[col1,row1] :='НАЗИВ КОРИСНИКА БУЏЕТСКИХ СРЕДСТАВА';
but then my cells aren't formatted the way I need them to be.

I know I'm using unicode characters, but proc1, or proc2 don't work even if I don't use unicode chars.

I'm using XLSReadWriteII 4 demo and Delphi 2009.

Thank you for your trouble.

Alexaris.

Re: Problem with saving strings

Posted: Fri Aug 26, 2011 12:43 pm
by Alexaris
Sorry, guys, false alarm. It seems to work now so it's all good.