Page 1 of 1

take on format from RTF-File to ReportHelper to RichView

Posted: Wed Feb 06, 2013 12:33 pm
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;

Posted: Wed Feb 06, 2013 3:47 pm
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