billy1222

博客园 首页 新随笔 联系 订阅 管理
针对ReportBuilder在Memo栏位打印时,会因为错误的切字处理,把中文切成两半,导致列印结果出现乱码的问题,提出解决方法
 

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 rbRCL**.dpk,在编译之前看一下Project Options里面有关目录的设定

a.Output directory:  C:\Windows\System32 or C:\Winnt\System32 or C:\Windows\SysWOW64\ 看你的电脑

b.Unit output directory: ..\Lib

c.DCP output directory: ..\Lib

 

3.在Report Builder裡面,Memo元件的 CharWarp要設定為False。

posted on 2015-04-15 00:11  billy1222  阅读(592)  评论(0)    收藏  举报