Trying to Copy InfoPower TwwDBRichEdit to RB RichText
I have tried numerous methods of copying the contents of IP's TwwDBRichEdit
including BOLD, ITALICS into a RB RichText component.
I followed the steps in the RB Readme.doc: ReportBuilder InfoPower RichEdit
Support for Delphi 7, and I still cannot copy from IP to RB.
I tried using the CopyRTF procedure (written by Mike Orriss), but it uses
TRichEdit components. I need to copy from TwwDBRichEdit to RB's RichText.
Knowing that this can be done, can anyone provide code for this?
TVM-IA (thx very much - in advance) !!!
--patrick
including BOLD, ITALICS into a RB RichText component.
I followed the steps in the RB Readme.doc: ReportBuilder InfoPower RichEdit
Support for Delphi 7, and I still cannot copy from IP to RB.
I tried using the CopyRTF procedure (written by Mike Orriss), but it uses
TRichEdit components. I need to copy from TwwDBRichEdit to RB's RichText.
Knowing that this can be done, can anyone provide code for this?
TVM-IA (thx very much - in advance) !!!
--patrick
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.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
When copying to a temp file: RichEdit1.Lines.SaveToFile('C:\TEMP.RTF'), and
when you open that file in Word, all of the
BOLD, ITALIC, UNDERLINE are there. RB is not copying the BOLD, ITALIC,
UNDERLINE when calling TppRichText.LoadFromFile('C:\TEMP.RTF');
--patrick
standard previewer.
By default, I use TExtraDevices to copy the report to a PDF, and the I
preview all reports in AcrobatReader. When you preview in pdf, you lose the
formats in the rtf/RichText.
thx--patrick