zoukankan      html  css  js  c++  java
  • How to: Customize the WinForms Report Designer Form 如何:自定义 WinForms 报表设计器窗体

    This example demonstrates how to access the Report Designer form by handling the WinReportServiceController.DesignFormCreated event.

    此示例演示如何通过处理 WinReportServiceController.DesignForm创建事件来访问报表设计器窗体。

    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.DesignFormCreated event.

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

    using System.Drawing.Design;
    using DevExpress.XtraReports.UserDesigner;
    using DevExpress.ExpressApp;
    using DevExpress.ExpressApp.ReportsV2.Win;
    // ...
    public class CustomDesignerController : ViewController {
        private WinReportServiceController winReportServiceController;
        protected override void OnActivated() {
            base.OnActivated();
            winReportServiceController = Frame.GetController<WinReportServiceController>();
            if (winReportServiceController != null) {
                winReportServiceController.DesignFormCreated += winReportServiceController_DesignFormCreated;
            }
        }
        void winReportServiceController_DesignFormCreated(object sender, DesignFormEventArgs e) {
            e.DesignForm.DesignMdiController.DesignPanelLoaded += DesignMdiController_DesignPanelLoaded;
        }
        void DesignMdiController_DesignPanelLoaded(object sender, DesignerLoadedEventArgs e) {
            IToolboxService ts = (IToolboxService)e.DesignerHost.GetService(typeof(IToolboxService));
            ts.AddToolboxItem(new ToolboxItem(typeof(MyControl)), "New Category");
        }
    }

    In this code, a custom component is added to the Report Designer toolbar for demonstration purposes. To learn about other possible customizations, refer to the Report Designer topic.

    在此代码中,自定义组件将添加到报表设计器工具栏中,以便进行演示。要了解其他可能的自定义项,请参阅报表设计器主题。

  • 相关阅读:
    webpack2使用ch4-向根目录index.html文件传参并使用参数 使用线上资源 压缩html
    webpack2使用ch3-自动化生成.html和内部引入的js自动更改
    webpack2使用ch2-entry和output简要说明
    webpack2使用ch1-目录说明
    less使用ch1--简单使用
    less使用ch1--认识语法
    vue2购物车ch4-(筛选v-for 点击的那个设置样式 设为默认地址其他 联动 非循环的列表选中和非选中 删除当前选中的列表)
    gulp使用2-gulp-less及watch和错误提示
    gulp使用1-入门指南
    vue2购物车ch3-(过滤器使用 单件商品金额计算 全选全不选 总金额计算 删除商品功能)
  • 原文地址:https://www.cnblogs.com/foreachlife/p/How-to-Customize-the-WinForms-Report-Designer-Form.html
Copyright © 2011-2022 走看看