expivot - sample code

How can I count and get the total of a specified column?

VBA (MS Access, Excell...)

With Pivot1
	.BeginUpdate 
	.Import "C:\Program Files\Exontrol\ExPivot\Sample\data.txt"
	.PivotColumnsFloatBarVisible = True
	.PivotRows = "0"
	.PivotColumns = "sum(5)"
	.PivotTotals = "sum,count"
	.EndUpdate 
End With

VB6

With Pivot1
	.BeginUpdate 
	.Import "C:\Program Files\Exontrol\ExPivot\Sample\data.txt"
	.PivotColumnsFloatBarVisible = True
	.PivotRows = "0"
	.PivotColumns = "sum(5)"
	.PivotTotals = "sum,count"
	.EndUpdate 
End With

VB.NET

With Expivot1
	.BeginUpdate()
	.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
	.PivotColumnsFloatBarVisible = True
	.PivotRows = "0"
	.PivotColumns = "sum(5)"
	.PivotTotals = "sum,count"
	.EndUpdate()
End With

VB.NET for /COM

With AxPivot1
	.BeginUpdate()
	.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
	.PivotColumnsFloatBarVisible = True
	.PivotRows = "0"
	.PivotColumns = "sum(5)"
	.PivotTotals = "sum,count"
	.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->PutPivotColumnsFloatBarVisible(VARIANT_TRUE);
spPivot1->PutPivotRows(L"0");
spPivot1->PutPivotColumns(L"sum(5)");
spPivot1->PutPivotTotals(L"sum,count");
spPivot1->EndUpdate();

C++ Builder

Pivot1->BeginUpdate();
Pivot1->Import(TVariant("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt"),TNoParam());
Pivot1->PivotColumnsFloatBarVisible = true;
Pivot1->PivotRows = L"0";
Pivot1->PivotColumns = L"sum(5)";
Pivot1->PivotTotals = L"sum,count";
Pivot1->EndUpdate();

C#

expivot1.BeginUpdate();
expivot1.Import("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt",null);
expivot1.PivotColumnsFloatBarVisible = true;
expivot1.PivotRows = "0";
expivot1.PivotColumns = "sum(5)";
expivot1.PivotTotals = "sum,count";
expivot1.EndUpdate();

JavaScript

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

<SCRIPT LANGUAGE="JScript">
	Pivot1.BeginUpdate();
	Pivot1.Import("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt",null);
	Pivot1.PivotColumnsFloatBarVisible = true;
	Pivot1.PivotRows = "0";
	Pivot1.PivotColumns = "sum(5)";
	Pivot1.PivotTotals = "sum,count";
	Pivot1.EndUpdate();
</SCRIPT>

C# for /COM

axPivot1.BeginUpdate();
axPivot1.Import("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt",null);
axPivot1.PivotColumnsFloatBarVisible = true;
axPivot1.PivotRows = "0";
axPivot1.PivotColumns = "sum(5)";
axPivot1.PivotTotals = "sum,count";
axPivot1.EndUpdate();

X++ (Dynamics Ax 2009)

public void init()
{
	;

	super();

	expivot1.BeginUpdate();
	expivot1.Import("C:\\Program Files\\Exontrol\\ExPivot\\Sample\\data.txt");
	expivot1.PivotColumnsFloatBarVisible(true);
	expivot1.PivotRows("0");
	expivot1.PivotColumns("sum(5)");
	expivot1.PivotTotals("sum,count");
	expivot1.EndUpdate();
}

Delphi 8 (.NET only)

with AxPivot1 do
begin
	BeginUpdate();
	Import('C:\Program Files\Exontrol\ExPivot\Sample\data.txt',Nil);
	PivotColumnsFloatBarVisible := True;
	PivotRows := '0';
	PivotColumns := 'sum(5)';
	PivotTotals := 'sum,count';
	EndUpdate();
end

Delphi (standard)

with Pivot1 do
begin
	BeginUpdate();
	Import('C:\Program Files\Exontrol\ExPivot\Sample\data.txt',Null);
	PivotColumnsFloatBarVisible := True;
	PivotRows := '0';
	PivotColumns := 'sum(5)';
	PivotTotals := 'sum,count';
	EndUpdate();
end

VFP

with thisform.Pivot1
	.BeginUpdate
	.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
	.PivotColumnsFloatBarVisible = .T.
	.PivotRows = "0"
	.PivotColumns = "sum(5)"
	.PivotTotals = "sum,count"
	.EndUpdate
endwith

dBASE Plus

local oPivot

oPivot = form.Activex1.nativeObject
oPivot.BeginUpdate()
oPivot.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
oPivot.PivotColumnsFloatBarVisible = true
oPivot.PivotRows = "0"
oPivot.PivotColumns = "sum(5)"
oPivot.PivotTotals = "sum,count"
oPivot.EndUpdate()

XBasic (Alpha Five)

Dim oPivot as P

oPivot = topparent:CONTROL_ACTIVEX1.activex
oPivot.BeginUpdate()
oPivot.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
oPivot.PivotColumnsFloatBarVisible = .t.
oPivot.PivotRows = "0"
oPivot.PivotColumns = "sum(5)"
oPivot.PivotTotals = "sum,count"
oPivot.EndUpdate()

Visual Objects


oDCOCX_Exontrol1:BeginUpdate()
oDCOCX_Exontrol1:Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt",nil)
oDCOCX_Exontrol1:PivotColumnsFloatBarVisible := true
oDCOCX_Exontrol1:PivotRows := "0"
oDCOCX_Exontrol1:PivotColumns := "sum(5)"
oDCOCX_Exontrol1:PivotTotals := "sum,count"
oDCOCX_Exontrol1:EndUpdate()

PowerBuilder

OleObject oPivot

oPivot = ole_1.Object
oPivot.BeginUpdate()
oPivot.Import("C:\Program Files\Exontrol\ExPivot\Sample\data.txt")
oPivot.PivotColumnsFloatBarVisible = true
oPivot.PivotRows = "0"
oPivot.PivotColumns = "sum(5)"
oPivot.PivotTotals = "sum,count"
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 ComPivotColumnsFloatBarVisible to True
	Set ComPivotRows to "0"
	Set ComPivotColumns to "sum(5)"
	Set ComPivotTotals to "sum,count"
	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 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:PivotColumnsFloatBarVisible := .T.
		oPivot:PivotRows := "0"
		oPivot:PivotColumns := "sum(5)"
		oPivot:PivotTotals := "sum,count"
		oPivot:EndUpdate()

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