<
OLAP for WPF and Silverlight | ComponentOne
C1.Olap Namespace / C1OlapEngine Class / BeginUpdate Method
Example

In This Topic
    BeginUpdate Method (C1OlapEngine)
    In This Topic
    Suspend automatic updates to the output table while defining the Olap view.
    Syntax
    'Declaration
     
    Public Sub BeginUpdate() 
    public void BeginUpdate()
    Remarks
    The C1OlapEngine updates the output table whenever the fields that make up the Olap view change. Before making multiple changes (such as defining a new Olap view), you can increase performance by enclosing the changes between calls to BeginUpdate and EndUpdate.
    Example
    The code below shows how to define a new Olap view efficiently by enclosing the changes between calls to BeginUpdate and EndUpdate.
    // set data source (populates Fields list)
    olap.DataSource = GetDataTable();
                
    // prevent updates while building Olap view
    olap.BeginUpdate();
                
    // show countries in rows
    olap.RowFields.Add("Country");
                
    // show categories and products in columns
    olap.ColumnFields.Add("Category");
    olap.ColumnFields.Add("Product");
                
    // show total sales in cells
    olap.ValueFields.Add("Sales");
                
    // done defining the view
    olap.EndUpdate();
    See Also