这是我以前贴过的,但只是修改后比没修改前的机率要小,没有解决根源,呵呵。
Rb的纸张也是很头痛的问题。
Report Machine 中国人的报表(FastReport翻版)可以解决乱码,去看看吧!
http://www.jnnj110.gov.cn/jingning/index.asp
ReportBuilder 6.03 DBmemo 汉字乱码解决方法
1.修改 RBuilder/Source/ppPlainText.pas 中 GetNextWord函数。
{参考旧帖:
673614帖: 谁能帮我解决我的DELPHI6。0折行问题我送他200分!!!!!}
...
{TppPlainTextParser.GetNextWord}
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];
(*-----------------Lighttop添加于2001年6月12日 ---*)
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
else
if (lCharacter = TppTextMarkups.Space) then
begin
lbEndOfWord := True;
if (lsWord = '') then
lsWord := TppTextMarkups.Space
else
Dec(FCharPos);
end
else
if (lCharacter = TppTextMarkups.CR) then
begin
lbEndOfWord := True;
if (lsWord <> '') then
Dec(FCharPos)
else
begin
if ((FCharPos + 1) <= FTextLength) and (FText[FCharPos + 1] = TppTextMarkups.LF) then
Inc(FCharPos);
{skip over the LF char since it was found immediately following CR}
if (FCharPos <= FTextLength) then
lsWord := TppTextMarkups.CRLF;
end;
end
else
if (lCharacter = TppTextMarkups.LF) then
begin
lbEndOfWord := True;
if (lsWord <> '') then
Dec(FCharPos)
else
if (FCharPos <= FTextLength) then
lsWord := TppTextMarkups.CRLF;
end
else
if (lCharacter = TppTextMarkups.Tab) then
begin
lbEndOfWord := True;
if (lsWord = '') then
lsWord := TppTextMarkups.Tab
else
Dec(FCharPos);
end
else
if ((FCharPos + 1) <= FTextLength) and (lCharacter + FText[FCharPos + 1] = TppTextMarkups.EOP) then
begin
lbEndOfWord := True;
if (lsWord <> '') then
Dec(FCharPos)
else
begin
Inc(FCharPos);
lsWord := TppTextMarkups.CRLF;
end;
end
else
lsWord := lsWord + lCharacter;
end;
end;
Result := lsWord;
end;
...
2.编译ppPlainText.pas;
将ppPlainText.dcu copy 至 RBuilder/lib 替换掉。