主要改fr_class.pas中的wrapline过程,其中有一段:
else
if s[last] = ' ' then
OutLine(Copy(s, beg, last - beg)) else
OutLine(Copy(s, beg, last - beg + 1));//造成乱码的根本原因
改为
else
if s[last] = ' ' then
OutLine(Copy(s, beg, last - beg)) else
if ByteType(s,last) = mbLeadByte then
//判断是否是汉字字节
OutLine(Copy(s, beg, last - beg ))
else
OutLine(Copy(s, beg, last - beg + 1));
后面的
LoopPos := cur;
beg := last + 1;
last := beg;
要改为:
LoopPos := cur;
if ByteType(s,last) = mbLeadByte then
begin
beg := last ;
last := beg;
end
else
begin
beg := last + 1;
last := beg;
end;
参照http://tian.yeah.net的 fastreport2.41c