property FormatConditionalAppearance.ForeColor as Color
Specifies the element's foreground color.

TypeDescription
Color A Color expression that defines the color to be applied on the object's foreground.
The ForeColor property specifies the foreground color to be applied on the columns/rows. The BackColor property defines the background color to be applied on the objects ( columns/rows ). The Expression property defines the conditional expression that determines whether the current format is applied on the pivot's cell based on the cell's value.

The following sample shows how you can shows the value with a value less than 100, with a gray color:

VBA (MS Access, Excell...)

With Pivot1
	.BeginUpdate 
	.Import "C:\Program Files\Exontrol\ExPivot\Sample\data.txt"
	.PivotRows = "0"
	With .FormatConditionalAppearances.Add("lower","lower","")
		.Expression = "len(value) != 0 ? (value < 100) : 0"
		.ForeColor = RGB(128,128,128)
	End With
	.PivotColumns = "sum(5)[lower]/12"
	.EndUpdate 
End With

VB6

With Pivot1
	.BeginUpdate 
	.Import "C:\Program Files\Exontrol\ExPivot\Sample\data.txt"
	.PivotRows = "0"
	With .FormatConditionalAppearances.Add("lower","lower","")
		.Expression = "len(value) != 0 ? (value < 100) : 0"
		.ForeColor = RGB(128,128,128)
	End With
	.PivotColumns = "sum(5)[lower]/12"
	.EndUpdate 
End With

VB.NET

With Expivot1
	.BeginUpdate()
	.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
	.PivotRows = "0"
	With .FormatConditionalAppearances.Add("lower","lower","")
		.Expression = "len(value) != 0 ? (value < 100) : 0"
		.ForeColor = Color.FromArgb(128,128,128)
	End With
	.PivotColumns = "sum(5)[lower]/12"
	.EndUpdate()
End With

VB.NET for /COM

With AxPivot1
	.BeginUpdate()
	.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
	.PivotRows = "0"
	With .FormatConditionalAppearances.Add("lower","lower","")
		.Expression = "len(value) != 0 ? (value < 100) : 0"
		.ForeColor = RGB(128,128,128)
	End With
	.PivotColumns = "sum(5)[lower]/12"
	.EndUpdate()
End With

C++

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXPIVOTLib' for the library: 'ExPivot 1.0 Control Library'

	#import <ExPivot.dll>
	using namespace EXPIVOTLib;
*/
EXPIVOTLib::IPivotPtr spPivot1 = GetDlgItem(IDC_PIVOT1)->GetControlUnknown();
spPivot1->BeginUpdate();
spPivot1->Import("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt",vtMissing);
spPivot1->PutPivotRows(L"0");
EXPIVOTLib::IFormatConditionalAppearancePtr var_FormatConditionalAppearance = spPivot1->GetFormatConditionalAppearances()->Add(L"lower","lower","");
	var_FormatConditionalAppearance->PutExpression(L"len(value) != 0 ? (value < 100) : 0");
	var_FormatConditionalAppearance->PutForeColor(RGB(128,128,128));
spPivot1->PutPivotColumns(L"sum(5)[lower]/12");
spPivot1->EndUpdate();

C++ Builder

Pivot1->BeginUpdate();
Pivot1->Import(TVariant("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt"),TNoParam());
Pivot1->PivotRows = L"0";
Expivotlib_tlb::IFormatConditionalAppearancePtr var_FormatConditionalAppearance = Pivot1->FormatConditionalAppearances->Add(L"lower",TVariant("lower"),TVariant(""));
	var_FormatConditionalAppearance->Expression = L"len(value) != 0 ? (value < 100) : 0";
	var_FormatConditionalAppearance->ForeColor = RGB(128,128,128);
Pivot1->PivotColumns = L"sum(5)[lower]/12";
Pivot1->EndUpdate();

C#

expivot1.BeginUpdate();
expivot1.Import("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt",null);
expivot1.PivotRows = "0";
exontrol.EXPIVOTLib.FormatConditionalAppearance var_FormatConditionalAppearance = expivot1.FormatConditionalAppearances.Add("lower","lower","");
	var_FormatConditionalAppearance.Expression = "len(value) != 0 ? (value < 100) : 0";
	var_FormatConditionalAppearance.ForeColor = Color.FromArgb(128,128,128);
expivot1.PivotColumns = "sum(5)[lower]/12";
expivot1.EndUpdate();

JScript/JavaScript

<BODY onload="Init()">
<OBJECT CLASSID="clsid:5C9DF3D3-81B1-42C4-BED6-658F17748686" id="Pivot1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
	Pivot1.BeginUpdate();
	Pivot1.Import("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt",null);
	Pivot1.PivotRows = "0";
	var var_FormatConditionalAppearance = Pivot1.FormatConditionalAppearances.Add("lower","lower","");
		var_FormatConditionalAppearance.Expression = "len(value) != 0 ? (value < 100) : 0";
		var_FormatConditionalAppearance.ForeColor = 8421504;
	Pivot1.PivotColumns = "sum(5)[lower]/12";
	Pivot1.EndUpdate();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload="Init()">
<OBJECT CLASSID="clsid:5C9DF3D3-81B1-42C4-BED6-658F17748686" id="Pivot1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
	With Pivot1
		.BeginUpdate 
		.Import "C:\Program Files\Exontrol\ExPivot\Sample\data.txt"
		.PivotRows = "0"
		With .FormatConditionalAppearances.Add("lower","lower","")
			.Expression = "len(value) != 0 ? (value < 100) : 0"
			.ForeColor = RGB(128,128,128)
		End With
		.PivotColumns = "sum(5)[lower]/12"
		.EndUpdate 
	End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axPivot1.BeginUpdate();
axPivot1.Import("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt",null);
axPivot1.PivotRows = "0";
EXPIVOTLib.FormatConditionalAppearance var_FormatConditionalAppearance = axPivot1.FormatConditionalAppearances.Add("lower","lower","");
	var_FormatConditionalAppearance.Expression = "len(value) != 0 ? (value < 100) : 0";
	var_FormatConditionalAppearance.ForeColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(128,128,128));
axPivot1.PivotColumns = "sum(5)[lower]/12";
axPivot1.EndUpdate();

X++ (Dynamics Ax 2009)

public void init()
{
	COM com_FormatConditionalAppearance;
	anytype var_FormatConditionalAppearance;
	;

	super();

	expivot1.BeginUpdate();
	expivot1.Import("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt");
	expivot1.PivotRows("0");
	var_FormatConditionalAppearance = COM::createFromObject(expivot1.FormatConditionalAppearances()).Add("lower","lower",""); com_FormatConditionalAppearance = var_FormatConditionalAppearance;
		com_FormatConditionalAppearance.Expression("len(value) != 0 ? (value < 100) : 0");
		com_FormatConditionalAppearance.ForeColor(WinApi::RGB2int(128,128,128));
	expivot1.PivotColumns("sum(5)[lower]/12");
	expivot1.EndUpdate();
}

Delphi 8 (.NET only)

with AxPivot1 do
begin
	BeginUpdate();
	Import('C:\Program Files\Exontrol\ExPivot\Sample\data.txt',Nil);
	PivotRows := '0';
	with FormatConditionalAppearances.Add('lower','lower','') do
	begin
		Expression := 'len(value) != 0 ? (value < 100) : 0';
		ForeColor := $808080;
	end;
	PivotColumns := 'sum(5)[lower]/12';
	EndUpdate();
end

Delphi (standard)

with Pivot1 do
begin
	BeginUpdate();
	Import('C:\Program Files\Exontrol\ExPivot\Sample\data.txt',Null);
	PivotRows := '0';
	with FormatConditionalAppearances.Add('lower','lower','') do
	begin
		Expression := 'len(value) != 0 ? (value < 100) : 0';
		ForeColor := $808080;
	end;
	PivotColumns := 'sum(5)[lower]/12';
	EndUpdate();
end

VFP

with thisform.Pivot1
	.BeginUpdate
	.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
	.PivotRows = "0"
	with .FormatConditionalAppearances.Add("lower","lower","")
		.Expression = "len(value) != 0 ? (value < 100) : 0"
		.ForeColor = RGB(128,128,128)
	endwith
	.PivotColumns = "sum(5)[lower]/12"
	.EndUpdate
endwith

dBASE Plus

local oPivot,var_FormatConditionalAppearance

oPivot = form.EXPIVOTACTIVEXCONTROL1.nativeObject
oPivot.BeginUpdate()
oPivot.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
oPivot.PivotRows = "0"
var_FormatConditionalAppearance = oPivot.FormatConditionalAppearances.Add("lower","lower","")
	var_FormatConditionalAppearance.Expression = "len(value) != 0 ? (value < 100) : 0"
	var_FormatConditionalAppearance.ForeColor = 0x808080
oPivot.PivotColumns = "sum(5)[lower]/12"
oPivot.EndUpdate()

XBasic (Alpha Five)

Dim oPivot as P
Dim var_FormatConditionalAppearance as P

oPivot = topparent:CONTROL_ACTIVEX1.activex
oPivot.BeginUpdate()
oPivot.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
oPivot.PivotRows = "0"
var_FormatConditionalAppearance = oPivot.FormatConditionalAppearances.Add("lower","lower","")
	var_FormatConditionalAppearance.Expression = "len(value) != 0 ? (value < 100) : 0"
	var_FormatConditionalAppearance.ForeColor = 8421504
oPivot.PivotColumns = "sum(5)[lower]/12"
oPivot.EndUpdate()

Visual Objects

local var_FormatConditionalAppearance as IFormatConditionalAppearance

oDCOCX_Exontrol1:BeginUpdate()
oDCOCX_Exontrol1:Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt",nil)
oDCOCX_Exontrol1:PivotRows := "0"
var_FormatConditionalAppearance := oDCOCX_Exontrol1:FormatConditionalAppearances:Add("lower","lower","")
	var_FormatConditionalAppearance:Expression := "len(value) != 0 ? (value < 100) : 0"
	var_FormatConditionalAppearance:ForeColor := RGB(128,128,128)
oDCOCX_Exontrol1:PivotColumns := "sum(5)[lower]/12"
oDCOCX_Exontrol1:EndUpdate()

PowerBuilder

OleObject oPivot,var_FormatConditionalAppearance

oPivot = ole_1.Object
oPivot.BeginUpdate()
oPivot.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
oPivot.PivotRows = "0"
var_FormatConditionalAppearance = oPivot.FormatConditionalAppearances.Add("lower","lower","")
	var_FormatConditionalAppearance.Expression = "len(value) != 0 ? (value < 100) : 0"
	var_FormatConditionalAppearance.ForeColor = RGB(128,128,128)
oPivot.PivotColumns = "sum(5)[lower]/12"
oPivot.EndUpdate()

Visual DataFlex

Procedure OnCreate
	Forward Send OnCreate
	Send ComBeginUpdate
	Get ComImport "C:\Program Files\Exontrol\ExPivot\Sample\data.txt" Nothing to Nothing
	Set ComPivotRows to "0"
	Variant voFormatConditionalAppearances
	Get ComFormatConditionalAppearances to voFormatConditionalAppearances
	Handle hoFormatConditionalAppearances
	Get Create (RefClass(cComFormatConditionalAppearances)) to hoFormatConditionalAppearances
	Set pvComObject of hoFormatConditionalAppearances to voFormatConditionalAppearances
		Variant voFormatConditionalAppearance
		Get ComAdd of hoFormatConditionalAppearances "lower" "lower" "" to voFormatConditionalAppearance
		Handle hoFormatConditionalAppearance
		Get Create (RefClass(cComFormatConditionalAppearance)) to hoFormatConditionalAppearance
		Set pvComObject of hoFormatConditionalAppearance to voFormatConditionalAppearance
			Set ComExpression of hoFormatConditionalAppearance to "len(value) != 0 ? (value < 100) : 0"
			Set ComForeColor of hoFormatConditionalAppearance to (RGB(128,128,128))
		Send Destroy to hoFormatConditionalAppearance
	Send Destroy to hoFormatConditionalAppearances
	Set ComPivotColumns to "sum(5)[lower]/12"
	Send ComEndUpdate
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oFormatConditionalAppearance
	LOCAL oPivot

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oPivot := XbpActiveXControl():new( oForm:drawingArea )
	oPivot:CLSID  := "Exontrol.Pivot.1" /*{5C9DF3D3-81B1-42C4-BED6-658F17748686}*/
	oPivot:create(,, {10,60},{610,370} )

		oPivot:BeginUpdate()
		oPivot:Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
		oPivot:PivotRows := "0"
		oFormatConditionalAppearance := oPivot:FormatConditionalAppearances():Add("lower","lower","")
			oFormatConditionalAppearance:Expression := "len(value) != 0 ? (value < 100) : 0"
			oFormatConditionalAppearance:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor  ( { 128,128,128 } )  , .F. ))
		oPivot:PivotColumns := "sum(5)[lower]/12"
		oPivot:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN