Add Method

Description

Adds a new field to the collection.

Syntax

Public Function Add( _
   ByVal sourceName As String, _
   ByVal Name As String, _
   ByVal location As OrientationConstants _
) As Field

Parameters

sourceName
The name of the field as it appears in the data source recordset. This is used as a key in the collection.
Name
The name of the field as it would be displayed in the DynamiCube view.
location
ValueDescription
DCHidden0  The field is hidden and does not appear in the current layout.
DCColumn1  The field appears as a column in the current layout.
DCRow2  The field appears as a row in the current layout.
DCData3  The field appears as a data field in the current layout.
DCPage4  The field appears as a page field in the current layout.
The location at which to add the field.

Example

[Add method (Visual Basic)] 

Dim f As DynamiCubeLibCtl.Field
Set f = DCube1.Fields.Add("Quantity*products.UnitPrice", "Total Sales", DCData)
f.AggregateFunc = DCSum
f.Position = 2
f.Calculated = True
f.varname = "Total"

See Also

Fields Collection

 

 


Copyright © 2007 Data Dynamics, Ltd. All rights reserved.