Skip to main content

PivotGridExtension.GetDataObject(PivotGridSettings, String) Method

Generates a chart data source from OLAP data.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.2.dll

Declaration

public static object GetDataObject(
    PivotGridSettings pivotGridSettings,
    string olapConnectionString
)

Parameters

Name Type Description
pivotGridSettings PivotGridSettings

A PivotGridSettings object that specifies pivot grid settings that define how to generate a chart data source.

olapConnectionString String

A String that specifies the connection string to an OLAP cube.

Returns

Type Description
Object

A chart data source.

Remarks

Use the static GetDataObject method in the controller to create a model for a Chart extension and pass it to the corresponding view.

The GetDataObject method internally creates a PivotGrid extension based on the provided settings, binds it to the specified OLAP cube and returns a chart data source provided by the created PivotGrid.

A sample OLAP connection string is shown below:

Provider=msolap;Data Source=localhost;Initial Catalog=Adventure Works DW;Cube Name=Adventure Works;Query Timeout=100;

This connection string provides the following parameters:

  • Provider - Identifies a data provider to be used. The “msolap” string identifies the latest version of Microsoft SQL Server Analysis Services (SSAS);
  • Data Source - Specifies the name of a server that runs an instance of SSAS;
  • Initial Catalog - Specifies a data catalog that contains cubes;
  • Cube Name - Specifies the name of a cube that provides OLAP data;
  • Query Timeout (optional) - the number of seconds to wait until a query to SSAS is completed. If this parameter is set to 0, each query can last for an indefinite time.

To create a chart data source from regular data, use another overload of the GetDataObject method that takes a dataSource parameter. To generate a chart data source from data when the Pivot Grid operates in server mode, use the PivotGridExtension.GetEFDataObject or PivotGridExtension.GetLINQDataObject methods depending on data provider type.

You can use the PivotGridSettings.BeforeGetDataObject property to apply custom settings to the PivotGrid before a Chart data source is generated but after the PivotGrid’s callback state is applied.

See Also