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

  • 主题发起人 主题发起人 xiaocai
  • 开始时间 开始时间
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;
 
接受答案了.
 
后退
顶部