zoukankan      html  css  js  c++  java
  • How to:Use the Custom WinForms Report Designer 如何:使用自定义 WinForms 报表设计器

    This example demonstrates how to use the custom Report Designer form by handling the WinReportServiceController.CreateCustomDesignForm event.

    此示例演示如何通过处理 WinReportServiceController.创建自定义设计窗体事件来使用自定义报表设计器窗体。

    In this topic, it is assumed that you have an XAF application that uses the Reports V2 Module, and you have created one or more reports (see Reports V2 Module Overview).

    在本主题中,假定您有一个使用报表 V2 模块的 XAF 应用程序,并且您创建了一个或多个报表(请参阅报表 V2 模块概述)。

    Create a View Controller in the WinForms module project. Override the Controller's OnActivated method, access the WinReportServiceController using the Frame.GetController<ControllerType> method and subscribe to the WinReportServiceController.CreateCustomDesignForm event.

    在 WinForms 模块项目中创建视图控制器。覆盖控制器的 On 已激活方法,使用 Frame.GetController<ControllerType> 方法访问 WinReport 服务控制器,并订阅 WinReportServiceController.创建自定义设计窗体事件。

    using DevExpress.ExpressApp;
    using DevExpress.ExpressApp.ReportsV2.Win;
    using DevExpress.XtraReports.UserDesigner;
    // ...
    public class CustomDesignerController : ViewController {
        private WinReportServiceController winReportServiceController;
        protected override void OnActivated() {
            base.OnActivated();
            winReportServiceController = Frame.GetController<WinReportServiceController>();
            if (winReportServiceController != null) {
                winReportServiceController.CreateCustomDesignForm +=
                    delegate(object sender, CreateCustomDesignFormEventArgs e) {
                        e.DesignForm = new XRDesignRibbonForm();
                    };
            }
        }
    }

    In the code above, the built-in XRDesignRibbonForm is used instead of the default XRDesignForm. You can create a custom form from scratch based on the Creating a Custom End-User Report Designer document and use it instead.

    在上面的代码中,使用内置的 XRDesignRibbonForm 而不是默认的 XRDesignForm。您可以基于"创建自定义最终用户报表设计器"文档从头开始创建自定义窗体,然后将其改用。

  • 相关阅读:
    Python学习笔记009_构造与析构
    Python学习笔记008_类_对象_继承_组合_类相关的BIF
    Python学习笔记007_图形用户界面[EasyGui][Tkinter]
    Python学习笔记006_异常_else_with
    Python学习笔记005_文件_OS_模块_pickle
    Python学习笔记004_字典_集合
    小甲鱼:Python学习笔记003_函数
    小甲鱼:Python学习笔记002_数组_元组_字符串
    Java数据库连接泄漏应对办法-基于Weblogic服务器
    java单点登录
  • 原文地址:https://www.cnblogs.com/foreachlife/p/How-to-Use-the-Custom-WinForms-Report-Designer.html
Copyright © 2011-2022 走看看