take on format from RTF-File to ReportHelper to RichView

General TRichView support forum. Please post your questions here
Post Reply
AXSchmidt
Posts: 20
Joined: Thu Mar 15, 2012 3:16 pm

take on format from RTF-File to ReportHelper to RichView

Post by AXSchmidt »

Hi,
Im loading a RTF file to a ReportHelper.
After that I copy from ReportHelper to RichView.
How is it possible to take on the formatting of the RTF document?

Code: Select all

// Load File in ReportHelper
TRVReportHelper.RichView.Clear;
TRVReportHelper.RichView.DeleteUnusedStyles(True,True,True);
TRVReportHelper.RichView.LoadRTF(filename);

// Copy Text from ReportHelper to RichView
TRVReportHelper.RichView.SaveRVFToStream(RVTmp, false);
RVTmp.Position := 0;
TRichView.Clear;
TRichView.LoadRVFFromStream(RVTmp);
TRichView.Format;
Sergey Tkachenko
Site Admin
Posts: 17564
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you mean, formatting of RTF is lost?

Make sure that RVReportHelper.RichView has the following values of properties:
RTFReadProperties.TextStyleMode = rvrsAddIfNeeded
RTFReadProperties.ParaStyleMode = rvrsAddIfNeeded
RVFOptions includes rvfoSaveTextStyles, rvfoSaveParaStyles

And the destination RichView has the following values of properties:
RVFTextStylesReadMode = rvf_sInsertMerge
RVFParaStylesReadMode = rvf_sInsertMerge
Post Reply