IPrxSheetHeaderPart.Text

Syntax

Text: String;

Description

The Text property determines text of the title or header and footer.

Comments

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:

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.

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.

Example

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.

See also:

IPrxSheetHeaderPart