Selection: IGxFlowDocumentSelection;
The Selection property determines selected string part in 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, Forms.Net (for the Fore.NET example) system assemblies. Add the button event:
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Rep: IPrxReport;
Doc: IPrxFlowDocument;
Sel: IGxFlowDocumentSelection;
Objs: ITabObjects;
TS: ITabSheet;
Begin
Rep := UiReport1.Report;
TS := (Rep.ActiveSheet As IPrxTable).TabSheet;
Objs := TS.Objects;
// Get current formatted text
Doc := Objs.Item(0).Extension As IPrxFlowDocument;
Sel := Doc.Selection;
// Determine font weight for selected text
Sel.IsBold := True;
End Sub Button1OnClick;
After executing the example formatting is applied to the selected text.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Forms.Net;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Imports Prognoz.Platform.Interop.Drawing;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Rep: IPrxReport;
Doc: IPrxFlowDocument;
Sel: IGxFlowDocumentSelection;
Objs: ITabObjects;
TS: ITabSheet;
Begin
Rep := uiReportNet1.ReportUi.Report;
TS := (Rep.ActiveSheet As IPrxTable).TabSheet;
Objs := TS.Objects;
// Get current formatted text
Doc := Objs.Item[0].Extension As IPrxFlowDocument;
Sel := Doc.Selection;
// Determine font weight for selected text
Sel.IsBold := True;
End Sub;
See also: