我用fastreport打印stringgrid表格内容,代码如下:
procedure TForm1.FormCreate(Sender: TObject);
var
  i, j: Integer;
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);
begin
  frxReport1.ShowReport;
end;procedure TForm1.frxReport1BeforePrint(c: TfrxReportComponent);
var
  Cross: TfrxCrossView;
  i, j: Integer;
begin
  if c is TfrxCrossView then
  begin
    Cross := TfrxCrossView(c);
    for i := 1 to 16 do
      for j := 1 to 16 do
        Cross.AddValue([i], [j], [StringGrid1.Cells[i - 1, j - 1]]);
  end;
end;当将formCreate中的这行代码:
StringGrid1.Cells[i - 1, j - 1] := IntToStr(i * j);中的IntToStr(i * j)换成字符(如'abc')时,会报错,提示string和double不能转换,是什么原因?如果我要实现打印stringgrid中字符或者让汉字,怎么实现?如何改代码?谢谢