FormattedText: String;
FormattedText: string;
The FormattedText property determines title text that is used to be displayed in the RTF format.
Information how to work with the RTF editor is presented in the Using Formatted Text article.
Executing the example requires that the repository contains an express report with the EXPRESS_FORMATTEDTEXT identifier, which contains a table.
Add links to the Drawing, Express, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Express: IEaxAnalyzer;
Title: IGxTitle;
HTML, HtmlTitle: String;
Converter: ITextConverter;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get express report
Express := MB.ItemById("EXPRESS_FORMATTEDTEXT").Edit As IEaxAnalyzer;
// Get title bar
Title := Express.TitleBar;
// Determine title value format
Title.CustomFormat := "# ##0,00";
// Display title text in the HTML markup language
HtmlTitle := Title.HtmlTitle;
Debug.WriteLine("Report title text in the HTML markup language - " + HtmlTitle);
// Make changes
HTML := "<span style=""font-size: 8pt;color: #000000;text-align: left;font-family: Arial; "">" +
"<span style=""color: #ff0000;font-size: 10pt;font-family: inherit;"">Important </span>" +
"<span style=""color: #0000ff;font-style: italic;font-size: 8pt;font-family: inherit;"">text</span></span>" ;
// Transformation into RTF from HTML
Converter := New TextConverter.Create;
Title.FormattedText := Converter.Export(HTML, TextFormat.Rtf);
// Make report title visible
Title.Visible := True;
Title.IsControl := False;
// Save changes
(Express As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the console window displays report title text in the HTML markup language, a new title text in the RTF format is displayed in express report.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.ForeSystem;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Express: IEaxAnalyzer;
Title: IGxTitle;
HTML, HtmlTitle: String;
Converter: ITextConverter;
Begin
// Get repository
MB := Params.Metabase;
// Get express report
Express := MB.ItemById["EXPRESS_FORMATTEDTEXT"].Edit() As IEaxAnalyzer;
// Get title bar
Title := Express.TitleBar;
// Determine title value format
Title.CustomFormat := "# ##0,00";
// Display title text in the HTML markup language
HtmlTitle := Title.HtmlTitle;
System.Diagnostics.Debug.WriteLine
("Report header text in the HTML markup language - " + HtmlTitle);
// Make changes
HTML := "<span style=""font-size: 8pt;color: #000000;text-align: left;font-family: Arial; "">" +
"<span style=""color: #ff0000;font-size: 10pt;font-family: inherit;"">Important </span>" +
"<span style=""color: #0000ff;font-style: italic;font-size: 8pt;font-family: inherit;"">text</span></span>" ;
// Transformation into RTF from HTML
Converter := New TextConverterClass.Create();
Title.FormattedText := Converter.Export(HTML, TextFormat.tfRtf);
// Make report title visible
Title.Visible := True;
Title.IsControl := False;
// Save changes
(Express As IMetabaseObject).Save();
End Sub;
See also: