zoukankan      html  css  js  c++  java
  • How to: Display a List View as a Pivot Grid Table and Chart如何:将列表视图显示为数据透视网格表和图表

    This topic demonstrates how to display a default List View as a pivot table in XAF applications:

    • Add the Pivot Grid Module
    • Change the List View's List Editor
    • Specify Chart Settings
    • Run the Application

    本主题演示如何在 XAF 应用程序中将默认列表视图显示为数据透视表:

    • 添加枢轴网格模块
    • 更改列表视图的列表编辑器
    • 指定图表设置
    • 运行应用程序

    The article uses a sample Order business object with the Customer, Product Name, Product Category, Price, and Units Purchased fields.

    本文使用示例订单业务对象,其中"客户、产品名称、产品类别、价格和购买单位"字段。

    PivotGridBefore1

    You can display the Order List View as a pivot table by adding the Pivot Grid Module to your application and replacing the default Grid List Editor with the Pivot Grid List Editor. The screenshot below demonstrates the result.

    通过将数据透视网格模块添加到应用程序并将默认网格列表编辑器替换为"透视网格列表编辑器",可以将订单列表视图显示为数据透视表。下面的屏幕截图演示了结果。

    PivotGridModuleResult

    You can see examples with Pivot Grid List Editors in the FeatureCenter demo shipped with XAF. The Feature Center demo is installed in %PUBLIC%DocumentsDevExpress Demos 19.2ComponentseXpressApp FrameworkFeatureCenter by default. The ASP.NET version of this demo is available online at http://demos.devexpress.com/XAF/FeatureCenter/

    您可以在 XAF 附带的功能中心演示中查看具有枢轴网格列表编辑器的示例。功能中心演示安装在%PUBLIC%DocumentsDevExpress Demos 19.2ComponentseXpressApp FrameworkFeatureCenter by default. The ASP.NET version of this demo is available online at http://demos.devexpress.com/XAF/FeatureCenter/

    .

    Note 注意
    Mobile applications do not support the Pivot Grid module.
    移动应用程序不支持枢轴网格模块。

    Add the Pivot Grid Module

    添加枢轴网格模块

    • Double click the Module.Win project's WinModule.cs file to invoke the Module Designer for this project.
    • Drag the PivotGridWindowsFormsModule item from the Toolbox onto the Required Modules panel.

    • 双击 Module.Win 项目的WinModule.cs文件以调用此项目的模块设计器。
    • 将"透视网格"Windows 窗体模块项目从"工具箱"拖到"必需模块"面板上。
    • PivotGrid006-AddModuleToWin

    • Double click the Module.Web project's WebModule.cs file to invoke the Module Designer for this project.
    • Drag the PivotGridAspNetModule item from the Toolbox onto the Required Modules panel.

    • 双击模块.Web 项目的WebModule.cs文件以调用此项目的模块设计器。

    • 将"透视网格"AspNet 模块项目从"工具箱"拖到"必需模块"面板上。

      PivotGrid007-AddModuleToWeb

    • Save the changes.
    • Rebuild your solution.
    • 保存更改。
    • 重建解决方案。

    Change the List View's List Editor

    更改列表视图的列表编辑器

    • Double-click the Module.Win project's Model.DesignedDiffs.xafml file to invoke the Model Editor for this project.
    • Navigate to the Views | Order_ListView node. In the EditorType (IModelListView.EditorType) property's drop-down, select "DevExpress.ExpressApp.PivotGrid.Win.PivotGridListEditor" instead of XAF's default List Editor.

    • 双击 Module.Win 项目的模型.设计Diffs.xafml 文件以调用此项目的模型编辑器。

    • 导航到视图 |Order_ListView节点。在编辑器类型 (IModelListView.编辑器类型) 属性的下拉列表中,选择"DevExpress.ExpressApp.PivotGrid.Win.PivotGridListEditor",而不是 XAF 的默认列表编辑器。

      PivotGrid008-ChangeEditorWin

    • Double-click the Module.Web project's Model.DesignedDiffs.xafml file to invoke the Model Editor for this project.
    • Navigate to the Views | Order_ListView node. In the EditorType property's drop-down, select "DevExpress.ExpressApp.PivotGrid.Web.ASPxPivotGridListEditor" instead of XAF's default List Editor.

    • 双击模块.Web 项目的模型.设计Diffs.xafml文件以调用此项目的模型编辑器。

    • 导航到视图 |Order_ListView节点。在编辑器类型属性的下拉列表中,选择"DevExpress.ExpressApp.PivotGrid.Web.ASPxPivotGridListEditor",而不是 XAF 的默认列表编辑器。

      PivotGrid-009ChangeWebEditor

    Specify Pivot Grid Settings

    指定枢轴网格设置

    • Invoke the Model Editor from the Module.Win project.
    • Navigate to the Views | Order_ListView_PivotGrid | PivotSettings node.

    • 从模块.Win 项目中调用模型编辑器。

    • 导航到视图 |Order_ListView_PivotGrid |透视设置节点。

      PivotGrid010-SettingsAgnostic

    • Set the IPivotSettings.ShowChart property value to true and IPivotSettings.CustomizationEnabled to false.
    • Select the IPivotSettings.Settings property and click its ellipsis button (EllipsisButton) to invoke the PivotGrid Designer.

    • 将 IPivotSettings.ShowChart 属性值设置为 true 和 IPivotSettings.自定义启用为 false。

    • 选择 IPivotSettings.Settings 属性,然后单击其省略号按钮(椭圆按钮)以调用数据透视网格设计器。

      PivotGrid012-AgnosticSettingsEllipsis

    • In the PivotGrid Designer, navigate to Main | Layout. Place the Product Name field in the Row Header Area, the Customer field in the Column Header Area area, and the Units Purchased field into the Data Header Area – as shown in the screenshot. Drag the Product Category and Price fields onto the Filter Header Area area to exclude them from the pivot table. This yields a pivot grid table summarizing sales arranged by customer.

    • 在数据透视网格设计器中,导航到主 |布局。将"产品名称"字段放在"行头区域"中,在"列标题区域"区域中放置"客户"字段,将"购买的单位"字段放入数据头区域, 如屏幕截图所示。将"产品类别"和"价格"字段拖到"筛选器标题区域"区域,以将其从数据透视表中排除。这将生成一个数据透视网格表,汇总按客户安排的销售额。

      PivotGrid013-Designer

    • Similarly, specify the Pivot Grid Module's settings in your Module.Web project.
    • 同样,在 Module.Web 项目.stomer 中指定数据透视网格模块的设置。

    Run the Application

    运行应用程序

    • Run the WinForms application and select the OrderNavigation Item to display the pivot table.

    • 运行 WinForms 应用程序并选择订单导航项以显示数据透视表。

    PivotGrid020-settings
    • Run the ASP.NET application and check that the Order pivot table is also available.

    • 运行ASP.NET应用程序,并检查订单数据透视表是否也可用。

      PivotGrid016-WebApp

    Tip 提示
    For more details on working with pivot tables, refer to the Pivot Grid control article (WinForms/ASP.NET) and watch the DevExpress Pivot Grid: Getting Started (WinForms
    有关使用数据透视表的更多详细信息,请参阅数据透视网格控制文章 (WinForms/ASP.NET),并观看 DevExpress 透视网格:入门(WinForms)
  • 相关阅读:
    ThreadLocal分析学习
    探究.NET的bin引用程序集运行机制看.NET程序集部署原理
    ASP.NET网页代码模型分析
    JBPM与设计模式之职责链模式
    根据webform页面大小的变化动态调整控件的大小
    jbpm binding类深入解析
    JBPM与软件架构模式之命令模式
    JBPM对象主键生成机制
    主键思维定势导致的惨案
    电脑安装windows server 2008 导致磁盘分区消失解决方法
  • 原文地址:https://www.cnblogs.com/foreachlife/p/How-to-Display-a-List-View-as-a-Pivot-Grid-Table-and-Chart.html
Copyright © 2011-2022 走看看