暂时搞定了!
参考旧帖:
673614帖: 谁能帮我解决我的DELPHI6。0折行问题我送他200分!!!!!
...
lighttop (2001-10-20 13:59:00)
装ReportBuilder 吧, 在www.51delphi.com 中有6.02版, 然后修改它的
ppPlainText.pas 这个文件中的GetNextWord函数, 注意我加的几行代码。
{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;
...
编译ppPlainText.pas;
将ppPlainText.dcu copy 至 RBuilder/lib 替换掉。
在delphi ide 环境下预览,乱码,但将程序编译后乱码解决了,
凑合着用吧,呵呵。