Setting Up Workbook Sheet Title

Executing the example requires that the repository contains a workbook with the OBJ123 identifier in which title settings are changed.

Add links to the following system assemblies:

Example

Sub UserProc;
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    MObj: IMetabaseObject;
    Exp: IEaxAnalyzer;
    Title: IGxTitle;
Begin
    MB := MetabaseClass.Active;
    //Open a workbook to edit
    MObj := MB.ItemById("OBJ123").Edit;
    Exp := MObj As IEaxAnalyzer;
    Title := Exp.TitleBar;
    //Display a workbook title
    Title.Visible := True;
    //Text
    Title.Text := "Report: &[Name]" + #13+#10 + "Date and time of creation: &[Date]  &[Time]";
    //Background and font color
    Title.BackgroundColor := GxColor.FromName("LavenderBlush");
    Title.TextColor := GxColor.FromName("SlateBlue");
    //Horizontal alignment of text
    Title.TextAlignment := GxStringAlignment.Near;
    //Vertical alignment of text
    Title.VerticalAlignment := GxVerticalAlignment.Center;
    //Text wrapping
    Title.WrappedText := True;
    //Autofit title height
    Title.AutoHeight := True;
    //Maximum height
    Title.Height := 50;
    //Using title as a control
    Title.IsControl := True;
    MObj.Save;
End Sub UserProc;

After executing the example the workbook title is displayed with changed format. The workbook title will contain its header, date and time of its creation.

See also:

Examples