请教!未见答案的ReportBuilder 中文换行乱码的问题如何解决 ( 积分: 200 )

  • 主题发起人 laidedou
  • 开始时间
L

laidedou

Unregistered / Unconfirmed
GUEST, unregistred user!
在ReportBuilder 中使用Memo控件时当遇到中英文混用时就会遇到换行产生乱码的问题,主要是由于中英文所占字节不同导致的拆字错误,不知道有高手解决没?期待中……
 

娃娃

Unregistered / Unconfirmed
GUEST, unregistred user!
1.修改Report Builder Source ppPlainText.pas:
function TppPlainTextParser.GetNextWord: string;
var
lbEndOfWord: Boolean;
lCharacter: Char;
lsWord: string;
begin

lsWord := '';
lbEndOfWord := False;
while not (lbEndOfWord) and not (FAllWordsParsed)do
begin
{move to next position in the text}
Inc(FCharPos);
{reached end of the text}
if (FCharPos > FTextLength) then
FAllWordsParsed := True
else
begin

lCharacter := FText[FCharPos];
if StrByteType(Pchar(FText), FCharPos - 1) = mbTrailByte then
begin
lbEndOfWord := True;
if (lsWord <> '') then
lsWord := lsWord + lCharacter;
end
else
if (lCharacter = TppTextMarkups.Null) then
FAllWordsParsed := True

2.重新编译 Package rbRCL66.dpk,在编译之前看一下Project Options里面有关目录的设定
a.Output directory: C:/Windows/System32 or C:/Winnt/System32 看你的计算机
b.Unit output directory: ../Lib
c.DCP output directory: ../Lib

3.在Report Builder里面,Memo组件的 CharWarp要设定为False。
这样应该就OK了。
 
顶部