property FormatAppearance.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 ).

How can I display the total with a different foreground color?

VBA (MS Access, Excell...)

With Pivot1
	.FormatAppearances.Add("fore").ForeColor = RGB(255,0,0)
	.Import "C:\Program Files\Exontrol\ExPivot\Sample\data.txt"
	.PivotRows = "0"
	.PivotColumns = "sum(5)"
	.PivotTotals = "sum[fore,bold]"
End With

VB6

With Pivot1
	.FormatAppearances.Add("fore").ForeColor = RGB(255,0,0)
	.Import "C:\Program Files\Exontrol\ExPivot\Sample\data.txt"
	.PivotRows = "0"
	.PivotColumns = "sum(5)"
	.PivotTotals = "sum[fore,bold]"
End With

VB.NET

With Expivot1
	.FormatAppearances.Add("fore").ForeColor = Color.FromArgb(255,0,0)
	.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
	.PivotRows = "0"
	.PivotColumns = "sum(5)"
	.PivotTotals = "sum[fore,bold]"
End With

VB.NET for /COM

With AxPivot1
	.FormatAppearances.Add("fore").ForeColor = RGB(255,0,0)
	.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
	.PivotRows = "0"
	.PivotColumns = "sum(5)"
	.PivotTotals = "sum[fore,bold]"
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->GetFormatAppearances()->Add(L"fore",vtMissing)->PutForeColor(RGB(255,0,0));
spPivot1->Import("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt",vtMissing);
spPivot1->PutPivotRows(L"0");
spPivot1->PutPivotColumns(L"sum(5)");
spPivot1->PutPivotTotals(L"sum[fore,bold]");

C++ Builder

Pivot1->FormatAppearances->Add(L"fore",TNoParam())->ForeColor = RGB(255,0,0);
Pivot1->Import(TVariant("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt"),TNoParam());
Pivot1->PivotRows = L"0";
Pivot1->PivotColumns = L"sum(5)";
Pivot1->PivotTotals = L"sum[fore,bold]";

C#

expivot1.FormatAppearances.Add("fore",null).ForeColor = Color.FromArgb(255,0,0);
expivot1.Import("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt",null);
expivot1.PivotRows = "0";
expivot1.PivotColumns = "sum(5)";
expivot1.PivotTotals = "sum[fore,bold]";

JavaScript

<OBJECT classid="clsid:5C9DF3D3-81B1-42C4-BED6-658F17748686" id="Pivot1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
	Pivot1.FormatAppearances.Add("fore",null).ForeColor = 255;
	Pivot1.Import("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt",null);
	Pivot1.PivotRows = "0";
	Pivot1.PivotColumns = "sum(5)";
	Pivot1.PivotTotals = "sum[fore,bold]";
</SCRIPT>

C# for /COM

axPivot1.FormatAppearances.Add("fore",null).ForeColor = (uint)ColorTranslator.ToWin32(Color.FromArgb(255,0,0));
axPivot1.Import("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt",null);
axPivot1.PivotRows = "0";
axPivot1.PivotColumns = "sum(5)";
axPivot1.PivotTotals = "sum[fore,bold]";

X++ (Dynamics Ax 2009)

public void init()
{
	COM com_FormatAppearance;
	anytype var_FormatAppearance;
	;

	super();

	var_FormatAppearance = COM::createFromObject(expivot1.FormatAppearances()).Add("fore"); com_FormatAppearance = var_FormatAppearance;
	com_FormatAppearance.ForeColor(WinApi::RGB2int(255,0,0));
	expivot1.Import("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt");
	expivot1.PivotRows("0");
	expivot1.PivotColumns("sum(5)");
	expivot1.PivotTotals("sum[fore,bold]");
}

Delphi 8 (.NET only)

with AxPivot1 do
begin
	FormatAppearances.Add('fore',Nil).ForeColor := $ff;
	Import('C:\Program Files\Exontrol\ExPivot\Sample\data.txt',Nil);
	PivotRows := '0';
	PivotColumns := 'sum(5)';
	PivotTotals := 'sum[fore,bold]';
end

Delphi (standard)

with Pivot1 do
begin
	FormatAppearances.Add('fore',Null).ForeColor := $ff;
	Import('C:\Program Files\Exontrol\ExPivot\Sample\data.txt',Null);
	PivotRows := '0';
	PivotColumns := 'sum(5)';
	PivotTotals := 'sum[fore,bold]';
end

VFP

with thisform.Pivot1
	.FormatAppearances.Add("fore").ForeColor = RGB(255,0,0)
	.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
	.PivotRows = "0"
	.PivotColumns = "sum(5)"
	.PivotTotals = "sum[fore,bold]"
endwith

dBASE Plus

local oPivot,var_FormatAppearance

oPivot = form.Activex1.nativeObject
// oPivot.FormatAppearances.Add("fore").ForeColor = 0xff
var_FormatAppearance = oPivot.FormatAppearances.Add("fore")
with (oPivot)
	TemplateDef = [Dim var_FormatAppearance]
	TemplateDef = var_FormatAppearance
	Template = [var_FormatAppearance.ForeColor = 0xff]
endwith
oPivot.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
oPivot.PivotRows = "0"
oPivot.PivotColumns = "sum(5)"
oPivot.PivotTotals = "sum[fore,bold]"

XBasic (Alpha Five)

Dim oPivot as P
Dim var_FormatAppearance as P

oPivot = topparent:CONTROL_ACTIVEX1.activex
' oPivot.FormatAppearances.Add("fore").ForeColor = 255
var_FormatAppearance = oPivot.FormatAppearances.Add("fore")
oPivot.TemplateDef = "Dim var_FormatAppearance"
oPivot.TemplateDef = var_FormatAppearance
oPivot.Template = "var_FormatAppearance.ForeColor = 255"

oPivot.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
oPivot.PivotRows = "0"
oPivot.PivotColumns = "sum(5)"
oPivot.PivotTotals = "sum[fore,bold]"

Visual Objects


oDCOCX_Exontrol1:FormatAppearances:Add("fore",nil):ForeColor := RGB(255,0,0)
oDCOCX_Exontrol1:Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt",nil)
oDCOCX_Exontrol1:PivotRows := "0"
oDCOCX_Exontrol1:PivotColumns := "sum(5)"
oDCOCX_Exontrol1:PivotTotals := "sum[fore,bold]"

PowerBuilder

OleObject oPivot

oPivot = ole_1.Object
oPivot.FormatAppearances.Add("fore").ForeColor = RGB(255,0,0)
oPivot.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
oPivot.PivotRows = "0"
oPivot.PivotColumns = "sum(5)"
oPivot.PivotTotals = "sum[fore,bold]"