FastReport中如何打印RICHEDIT中的内容?(10分)

X

xiaocai

Unregistered / Unconfirmed
GUEST, unregistred user!
同题,我已经全部做好,但是在BEFOREPRINT中加上了
if Memo.Count > 0 then
if (Memo[0] = '[RTF]') and (View is TfrRichView) then
Memo.Assign(RTFEditor.Lines)
else
if (Memo[0] = '[PHOTO]') and (View is TfrPictureView) then
(View as TfrPictureView).Picture.Assign(Photo.Picture);
但是RTF内容出不来,照片是正常的,请有做过的朋友指点一二?
 
procedure AssignRich(Rich1, Rich2: TRichEdit);
var
st: TMemoryStream;
begin
st := TMemoryStream.Create;
with Rich2do
begin
SelStart := 0;
SelLength := Length(Text);
SelAttributes.Protected := False;
Lines.SaveToStream(st);
end;
st.Position := 0;
Rich1.Lines.LoadFromStream(st);
st.Free;
end;

begin
if Memo.Count > 0 then
if (Memo[0] = '[RTF]') and (View is TfrRichView) then
AssignRich(TfrRichView(View).RichEdit, RTFEditor)
else
if (Memo[0] = '[PHOTO]') and (View is TfrPictureView) then
(View as TfrPictureView).Picture.Assign(Photo.Picture);
end;
 
接受答案了.
 

Similar threads

D
回复
0
查看
713
DelphiTeacher的专栏
D
I
回复
0
查看
698
import
I
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
顶部