ITabCellStyle.CustomFormat

Fore Syntax

CustomFormat: String;

Fore.NET Syntax

CustomFormat: string;

Description

The CustomFormat property determines the data display format in the table cell.

Comments

This property is independent on the OS regional interface settings, that is when this property value is defined, commas and spaces are used as separators for data in the cell.

The data display format is formed by reserved format codes. Codes are described in the Number Format section. Define data display format in the Russian variant of code format to correctly show while changing interface language settings of Foresight Analytics Platform. For example, the format of date display DD.MM.YYYY will be correctly displayed in any selected system interface language. At the same time the format DD.MM.YYYY will be available only in English version.

The value of this property is affected by the LocalCustomFormat property: when a user determines the value for the LocalCustomFormat property, the value is converted to the general form (ignoring the regional parameters settings) and is set to the CustomFormat property. In addition, on getting the value of the LocalCustomFormat property, it returns the value of the CustomFormat property converted to the local format according to the regional settings.

Fore Example

To execute the example a form with a button on this form named Button1, the UiTabSheet component named UiTabSheet1 and a TabSheetBox component are required. In the regional settings a point must be set as a decimal separator.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var Style: ITabCellStyle;
    Custom, Local: String;
Begin
    Style := UiTabSheet1.TabSheet.Cell(00).Style;
    Style.CustomFormat := "0,00";
    Custom := Style.CustomFormat;
    Local := Style.LocalCustomFormat;
End Sub Button1OnClick;

After executing this example the A0 cell has the following format: a number with two decimal positions. The Custom variable will contain the common template for a number, ignoring regional settings: "0,00". The variable "Local" will contain the localized (according to the regional settings) template for a number: "0.00".

Fore.NET Example

To execute the example a form with a button named Button1 on it, a UiTabSheetNet component named UiTabSheetNet1 and a TabSheetBoxNet component are required. In the regional settings a point must be set as a decimal separator.

Imports System;
Imports Prognoz.Platform.Forms.Net;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Tab;

Public Partial Class OBJ271Form: Prognoz.Platform.Forms.Net.ForeNetForm
    Public Constructor OBJ271Form();
    Begin
        InitializeComponent();
    End Constructor;
    
    Private Sub button1_Click(sender: System.Object; e: System.EventArgs);      
    Var Style: ITabCellStyle;
        Custom, Local: String;
    Begin
        Style := UiTabSheetNet1.TabSheetUi.TabSheet.Cell[00].Style;
        Style.CustomFormat := "0,00";
        Custom := Style.CustomFormat;
        Local := Style.LocalCustomFormat;
    End Sub;
End Class;

After executing this example the A0 cell has the following format: a number with two decimal positions. The Custom variable will contain the common template for a number, ignoring regional settings: "0,00". The Local variable will contain the localized (according to the regional settings) template for a number: "0.00".

See also:

ITabCellStyle