LoadFormattedText:(Text: String);
Text. String is in the RTF format.
The LoadFormattedText method loads the string to the formatted text field.
Executing the example requires:
The UiReport class object with the UiReport1 identifier set for regular report.
The ReportBox class object with the ReportBox1 identifier set for UiReport1.
The first report object should be formatted text.
Add links to the Report, Tab, Drawing, Forms, Metabase system assemblies. Add the button event:
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Rep: IPrxReport;
Doc: IPrxFlowDocument;
Text: String;
Rect: IGxRectF;
Obj: ITabObject;
Objs: ITabObjects;
TS: ITabSheet;
Begin
Rep := UiReport1.Report;
// Get current formatted text
TS := (Rep.ActiveSheet As IPrxTable).TabSheet;
Objs := TS.Objects;
Doc := Objs.Item(0).Extension As IPrxFlowDocument;
Text := Doc.SaveFormattedText;
Rect := New GxRectF.Create(0, 0, 50, 50);
// Create a new formatted text
Obj := Objs.Add("PrxFlowDocument", Rect);
Doc := Objs.Item(1).Extension As IPrxFlowDocument;
Doc.LoadFormattedText(Text);
End Sub Button1OnClick;
After executing the example a copy of formatted text will be created.
See also: