Procedure TForm1. FormCreate (Sender: TObject);
Var
I, j: Integer;
The begin
For I:=1 to 16 do
For j:=1 to 16 do
StringGrid1. Cells [] I - 1, j - 1:=IntToStr (I * j);
end;
Procedure TForm1. Button1Click (Sender: TObject);
The begin
FrxReport1. ShowReport;
end;
Procedure TForm1. FrxReport1BeforePrint (c: TfrxReportComponent);
Var
Cross: TfrxCrossView;
I, j: Integer;
The begin
If c is TfrxCrossView then
The begin
Cross:=TfrxCrossView (c);
For I:=1 to 16 do
For j:=1 to 16 do
Cross. AddValue ([I], [j], [StringGrid1. Cells [j - I - 1, 1]]).
end;
end;
When will this line of code in the formCreate:
StringGrid1. Cells [] I - 1, j - 1:=IntToStr (I * j); The IntToStr (I * j) into characters (such as' ABC '), complains, prompt string and double can't conversion, what reason be? If I want to achieve in print stringgrid character or let Chinese characters, how to implement? How to change the code? Thank you
CodePudding user response:
Top up, no one answerCodePudding user response:
Is there a man met a similar problemCodePudding user response:
Can not ah, I * j is int,,,CodePudding user response:
IntToStr (I * j); I * j is an integer, so use IntToStr correctly.For IntToStr (' ABC '), there is a string, so no translation, use IntToStr errors.