ITabCellStyle.DisplayEmptyAs

Syntax

DisplayEmptyAs: String;

Description

The DisplayEmptyAs property specifies text defined for the cells with missing values.

Comments

Replacement of empty cells depends on access permissions to data contained in cells. Access permissions are determined using the TabAccessRights enumeration. Full access to data is used by default. If the ITabCellStyle.AccessRights property is set to TabAccessRights.NoAccess or TabAccessRights.Write, replacement of empty cells will be unavailable.

Example

Executing the example requires a regular report with the REGULAR_REPORT identifier. The report can contain values in random table cells.

Add links to the Metabase, Report and Tab system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Report: IPrxReport;
    TabSheet: ITabSheet;
    TRange: ITabRange;
    Style: ITabCellStyle;
Begin
    MB := MetabaseClass.Active;
    // Get regular report
    Report := MB.ItemById("REGULAR_REPORT").Edit As IPrxReport;
    // Get table
    TabSheet := (Report.ActiveSheet As IPrxTable).TabSheet;
    // Set cell range
    TRange := TabSheet.Cells(1,2,3,5);
    // Replace empty cells with the specified value
    Style:= TRange.Style;
    Style.DisplayEmptyAs:= "Empty";
    // Save changes
    (Report As IMetabaseObject).Save;
End Sub UserProc;

After executing the example, the cells that do not contain values in the C1:F3 range will display the Empty text.

See also:

ITabCellStyle