Rich Text
I have a delphi App which is a RichText Editor. I am trying to use a
ppReport Component as a print previewer.
I put a RichText in the Header Band and set it's stretch Property to True.
Just before I Print the report use the following:
ReportRichText.RichText := FormRichText.Text;
However when the preview form shows up all the formatting is gone and I have
just the plain text. How do I keep the Formatting?
S
ppReport Component as a print previewer.
I put a RichText in the Header Band and set it's stretch Property to True.
Just before I Print the report use the following:
ReportRichText.RichText := FormRichText.Text;
However when the preview form shows up all the formatting is gone and I have
just the plain text. How do I keep the Formatting?
S
This discussion has been closed.
Comments
Tech Tip: Copy RTF data from TRichEd to TppRichText
------------------------------------------------
You can copy RTF data from Delphi's TRichEd to ReportBuilder's TppRichText
control by using an intermediate memory stream:
var
lRTFStream: TMemoryStream;
begin
{create temp memory stream}
lRTFStream := TMemoryStream.Create;
{save the TRichEd's rtf data to the memory stream}
RichEdit1.Lines.SaveToStream(lRTFStream);
{load the rtf stream to the TppRichText}
lRTFStream.position := 0;
ppRichText1.LoadFromRTFStream(lRTFStream);
{free the memory stream}
lRTFStream.Free;
end;
Note: An alternative method would be to use RichEdit1.Lines.SaveToFile and
TppRichText.LoadFromFile.
--
Tech Support mailto:support@digital-metaphors.com
Digital Metaphors http://www.digital-metaphors.com
--
Nard Moseley
Digital Metaphors Corporation
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
ppRichText1.SelText:= aStringWithRtfFormat;
Excellent suggestion.
--
Nard Moseley
Digital Metaphors Corporation
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com