彩票走势图

DevExpress如何在运行时查看Adventure Works多维数据集的数据

原创|其它|编辑:郝浩|2012-10-17 17:29:20.000|阅读 248 次

概述:数据查看一直是我们的常规应用,那么DevExpress是如何在运行时查看Adventure Works多维数据集数据的呢?下面,我们就给出一个具体代码事例供大家参考.

# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>

 数据查看一直是我们的常规应用,那么DevExpress是如何在运行时查看Adventure Works多维数据集数据的呢?下面,我们就给出一个具体代码事例供大家参考:

C#

using DevExpress.XtraPivotGrid;

// Create a PivotGridControl. 
PivotGridControl pivotControl = new PivotGridControl();
pivotControl.Dock = DockStyle.Fill;
this.Controls.Add(pivotControl);
// Specify the connection string 
pivotControl.OLAPConnectionString = "Provider=msolap;Data Source=localhost;Initial Catalog=Adventure Works DW;Cube Name=Adventure Works;";
// Create fields. 
PivotGridField fieldMeasuresInternetSalesAmount = new PivotGridField("[Measures].[Internet Sales Amount]", PivotArea.DataArea);
fieldMeasuresInternetSalesAmount.Caption = "Internet Sales Amount";
PivotGridField fieldCustomerCountryCountry = new PivotGridField("[Customer].[Country].[Country]", PivotArea.RowArea);
fieldCustomerCountryCountry.Caption = "Country";
PivotGridField fieldDateFiscalYearFiscalYear = new PivotGridField("[Date].[Fiscal Year].[Fiscal Year]", PivotArea.ColumnArea);
fieldDateFiscalYearFiscalYear.Caption = "Fiscal Year";
// Add fields to the PivotGridControl 
pivotControl.Fields.AddRange(new PivotGridField[] { fieldMeasuresInternetSalesAmount, fieldCustomerCountryCountry,
    fieldDateFiscalYearFiscalYear });

VB

Imports DevExpress.XtraPivotGrid

' Create a PivotGridControl. 
Dim pivotControl As PivotGridControl = New PivotGridControl()
pivotControl.Dock = DockStyle.Fill
Me.Controls.Add(pivotControl)
' Specify the connection string 
pivotControl.OLAPConnectionString = "Provider=msolap;Data Source=localhost;Initial Catalog=Adventure Works DW;Cube Name=Adventure Works;" 
' Create fields. 
Dim fieldMeasuresInternetSalesAmount As PivotGridField = New PivotGridField("[Measures].[Internet Sales Amount]", PivotArea.DataArea)
fieldMeasuresInternetSalesAmount.Caption = "Internet Sales Amount" 
Dim fieldCustomerCountryCountry As PivotGridField = New PivotGridField("[Customer].[Country].[Country]", PivotArea.RowArea)
fieldCustomerCountryCountry.Caption = "Country" 
Dim fieldDateFiscalYearFiscalYear As PivotGridField = New PivotGridField("[Date].[Fiscal Year].[Fiscal Year]", PivotArea.ColumnArea)
fieldDateFiscalYearFiscalYear.Caption = "Fiscal Year" 
' Add fields to the PivotGridControl 
pivotControl.Fields.AddRange(New PivotGridField() {fieldMeasuresInternetSalesAmount, fieldCustomerCountryCountry, _
    fieldDateFiscalYearFiscalYear})



标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@cahobeh.cn

文章转载自:慧都控件网

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
相关产品
DevExpress Universal Subscription

行业领先的界面控件开发包,帮助企业构建卓越应用!

DevExpress WPF Subscription

高效MVVM开发模式,WPF界面解决方案首选工具,帮助企业实现酷炫动效界面。

DevExpress Silverlight Controls

高性价比高实用性的Silverlight用户界面控件套包,拥有大量的示例和帮助文档,开发者能够快速上手!

DevExpress WinForms Subscription

为Windows Forms平台创建具有影响力的业务解决方案,高性价比WinForms界面控件套包。

DevExpress DXperience Subscription

高性价比的企业级.NET用户界面套包,助力企业创建卓越应用!

title
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP