SetSel(Begin_: Integer; End_: Integer);
SetSel(@Begin: integer; @End: integer);
Begin_. Start position of selected section in the header.
End_. End position of selected section in the header.
The SetSel method selects needed section in the express report header.
For total selection of express report selection, use IErAnalyzerTitle.SelectAll.
Executing the example requires that the repository contains form with the following components:
ErAnalyzerTitle with the ErAnalyzerTitle1 identifier.
UiErAnalyzer with the UiErAnalyzer1 identifier which is data source for ErAnalyzerTitle1.
Express report with active header must be set for UiErAnalyzer1 as data source.
Sub UserProc;
Var
Xaml: String;
Begin
// Enable edit mode for header
ErAnalyzerTitle1.StartEdit;
// Select header section
ErAnalyzerTitle1.SetSel(ErAnalyzerTitle1.BeginSel + 1, ErAnalyzerTitle1.EndSel - 1);
// Cut selected section
ErAnalyzerTitle1.Cut;
// Insert dimension name
ErAnalyzerTitle1.InsertSelection;
// Set express report name
ErAnalyzerTitle1.InsertName;
// Insert current time
ErAnalyzerTitle1.InsertTime;
// Insert current time
ErAnalyzerTitle1.InsertDate;
// Insert specified text
ErAnalyzerTitle1.InsertText("Added_text");
// Insert cut section
ErAnalyzerTitle1.Paste;
// Set bold underlined italic
ErAnalyzerTitle1.Bold := True;
ErAnalyzerTitle1.Italic := True;
ErAnalyzerTitle1.Underline := True;
// Set size and font family
ErAnalyzerTitle1.FontSize := 20;
ErAnalyzerTitle1.FontFamily := "Arial";
// Select all the header
ErAnalyzerTitle1.SelectAll;
// Copy header text in clipboard
ErAnalyzerTitle1.Copy;
// Insert to header
ErAnalyzerTitle1.Paste;
// Get header text in the RTF format
Xaml := ErAnalyzerTitle1.Xaml;
// Display to the console header text used to be shown in the RTF format
Debug.WriteLine("Header text used to be shown in the RTF format - " + Xaml);
// Finish header editing
ErAnalyzerTitle1.EndEdit;
End Sub UserProc;
After executing the example all properties and methods specified above will be applied to the express report header.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example. Use Fore.NET analogs instead of Fore components.
Sub UserProc();
Var
Xaml: String;
Begin
// Enable edit mode for header
ErAnalyzerTitleNet1.CtrlBox.StartEdit();
// Select header section
ErAnalyzerTitleNet1.CtrlBox.SetSel(ErAnalyzerTitleNet1.CtrlBox.BeginSel + 1, ErAnalyzerTitleNet1.CtrlBox.EndSel - 1);
// Cut selected section
ErAnalyzerTitleNet1.CtrlBox.Cut();
// Insert dimension name
ErAnalyzerTitleNet1.CtrlBox.InsertSelection();
// Set express report name
ErAnalyzerTitleNet1.CtrlBox.InsertName();
// Insert current time
ErAnalyzerTitleNet1.CtrlBox.InsertTime();
// Insert current time
ErAnalyzerTitleNet1.CtrlBox.InsertDate();
// Insert specified text
ErAnalyzerTitleNet1.CtrlBox.InsertText("Added_text");
// Insert cut section
ErAnalyzerTitleNet1.CtrlBox.Paste();
// Set bold underlined italic
ErAnalyzerTitleNet1.CtrlBox.Bold := True;
ErAnalyzerTitleNet1.CtrlBox.Italic := True;
ErAnalyzerTitleNet1.CtrlBox.Underline := True;
// Set size and font family
ErAnalyzerTitleNet1.CtrlBox.FontSize := 20;
ErAnalyzerTitleNet1.CtrlBox.FontFamily := "Arial";
// Select all the header
ErAnalyzerTitleNet1.CtrlBox.SelectAll();
// Copy header in the clipboard
ErAnalyzerTitleNet1.CtrlBox.Copy();
// Insert to header
ErAnalyzerTitleNet1.CtrlBox.Paste();
// Get header text in the RTF format
Xaml := ErAnalyzerTitleNet1.CtrlBox.Xaml;
// Display to the console header text in the RTF format
System.Diagnostics.Debug.WriteLine("Header text used to be shown in the RTF format - " + Xaml);
// Display to the console header text used to be shown in the RTF format
ErAnalyzerTitleNet1.CtrlBox.EndEdit();
End Sub UserProc;
See also: