Text: String;
Text: String;
The Text property determines text of the title or header and footer.
To display text of a title or a header and footer, specify its color (IPrxSheetHeaderPart.Color). To specify a text, you can use a static text and special substitutions or tags:
Substitution/tag | Description |
&[Page] | Inserts the current page number in the current position. |
&[Pages] | Inserts the number of pages of the report in the current position. |
&[Date] | Inserts the current date in the current position. |
&[Time] | Inserts the current time in the current position. |
&[Name] | Inserts the report name in the current position. |
&[Sheet.Page] | Inserts the number of the page in the current sheet. |
&[Sheet.Pages] | Inserts the total number of pages in the current report sheet. |
&[Picture] | Inserts an image in the current position. |
&[Globals.<Variable identifier>] | Inserts value of the global variable in the current position. |
&[<Slice identifier>.Selection] | Inserts the selection by fixed dimensions of the slice in the current position. |
&[<Slice identifier>.<Dictionary identifier>.Selection] | Inserts the selection of selected dimension in the current position. |
&[<Sheet identifier>.<Control identifier>.Value] | Inserts value of a control in the current position. Sheet identifier may be omitted in the tag if the control is available for all sheets. |
You can use advanced attributes for the tags related to dimensions selection:
Format – determines the format of selection output. Use the Name and Value parameters to create a format, which are replaced with the dimension name and dimension selection respectively. Format examples:
Name: Value.
Value (Name).
Name (Value).
Value.
This attribute can be used for the tag associated with the value of the control. In this case the Name and Value parameters are replaced with the name of the control and its value respectively.
Part - determines selection of dimensions depending on their position in the slice. The following variants are possible:
Rows - dimensions located in rows.
Columns - dimensions located in columns.
Fixed - fixed dimensions.
Examples of tags:
&[Slice1.Selection Part = "Columns" Format = "Name: Value"]
Displays information on dimensions located in rows in the current position: dimension name first, then dimension selection.
&[ITEM1.Value Format = "Name: Value"]
Displays name and value of a control in the current position.
&[Slice1.D_TO.Selection Format = "Name: Value"]
Displays name of the specified dimension and then its selection in the current position.
Real text, which is formed with tags, can be obtained by using the IGxDocument.GetTagText method.
Executing the example requires that the repository contains a regular report with the Report_1 identifier.
Sub UserProc;
Var
MB: IMetabase;
Report: IPrxReport;
Header: IPrxReportTitle;
HeaderPart: IPrxSheetHeaderPart;
Begin
MB := MetabaseClass.Active;
Report := MB.ItemById("Report_1").Edit As IPrxReport;
Header := Report.Title;
HeaderPart := Header.Center;
HeaderPart.Text := "&[Name] &[Date]";
HeaderPart.Color := GxColor.FromName("Blue");
(Report As IMetabaseObject).Save;
End Sub UserProc;
After executing the example central part of the regular report title displays the name of the regular report and the current date.
Executing the example requires that the repository contains a regular report with the Report_1 identifier. The specified example is an entry point for a .NET assembly.
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Report: IPrxReport;
Header: IPrxReportTitle;
HeaderPart: IPrxSheetHeaderPart;
GxColorCls: GxColorClass = New GxColorClassClass();
Begin
MB := Params.Metabase;
Report := MB.ItemById["Report_1"].Edit() As IPrxReport;
Header := Report.Title;
HeaderPart := Header.Center;
HeaderPart.Text := "&[Name] &[Date]";
HeaderPart.Color := GxColorCls.FromName("Blue");
(Report As IMetabaseObject).Save();
End Sub;
After executing the example central part of the regular report title displays the name of the regular report and the current date.
See also: