QuickReport 转换成 FastReport时,中文乱码的解决方式

我用的是fastreport 4.68

这个版本中有个单元:ConverterQR2FR.pas,就是用来将 quickrep转换成fastreport的,转换过程中,注意事项:

1.代码中要 using ConverterQR2FR

2.quickreport要4.0以上的版本,delphi6自带的版本缺少一个const定义,无法转换 delphifasns.com上有quickrep4.05的下载

3.默认转换时可能会出现中文乱码,当时第一印象就是字符集,马上打开ConverterQR2FR.pas看了一下,有如下这段话:

if Lbl.Caption = '' then
  Memo.Memo.Text := Lbl.Lines.Text
  else
  Memo.Memo.Text := Lbl.Caption;
  Memo.Font.Assign(Lbl.Font);

然后我改了一下:

//Memo.Font.Assign(Lbl.Font);
  Memo.Font.Size := lbl.Font.Size;
  Memo.Font.Name := lbl.Font.Name;
  memo.Font.Color := lbl.Font.Color;
  memo.Font.Charset := lbl.Font.Charset;

调试一下发现,果然是这个charset的问题

最终解决方案是

  Memo.Font.Assign(Lbl.Font);
  //Memo.Font.Size := lbl.Font.Size;
  //Memo.Font.Name := lbl.Font.Name;
  //memo.Font.Color := lbl.Font.Color;
  memo.Font.Charset := 1;


posted @ 2008-10-22 14:16  _Zerg  阅读(1199)  评论(1编辑  收藏  举报