zoukankan      html  css  js  c++  java
  • [Dxperience.8.*]XtraReport的设计器,其实用XRDesignFormEx就挺好。

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using DevExpress.XtraReports.UI;
    using DevExpress.XtraReports.UserDesigner;
    using System.Drawing.Design;
    using System.ComponentModel.Design;

    namespace WindowsFormsApplication2
    {
        
    public partial class Form1 : Form
        {
            XtraReport r ;
            
    public Form1()
            {
                InitializeComponent();
            }

            
    void designForm_FormClosing(object sender, FormClosingEventArgs e)
            {
                
    //在此处处理关闭设计器时的操作,主要用来自定义保存数据
                
    //r.SaveLayout(@"C:\1.repx");
            }

            
    void designForm_ReportStateChanged(object sender, ReportStateEventArgs e)
            {
                
    //只要报表发生改变就立即将状态设置为保存
                
    //避免系统默认保存对话框的出现
                if (e.ReportState == ReportState.Changed)
                {
                    ((XRDesignFormEx)sender).DesignPanel.ReportState 
    = ReportState.Saved;
                }
            }

            
    private void Form1_Load(object sender, EventArgs e)
            {
                r 
    = new XtraReport();
                
    //r.LoadLayout(@"C:\1.repx");
                XRDesignFormEx designForm = new XRDesignFormEx();

                
    //隐藏按钮
                designForm.DesignPanel.SetCommandVisibility(new ReportCommand[]{
                    ReportCommand.NewReport,
                    ReportCommand.SaveFileAs,
                    ReportCommand.NewReportWizard,
                    ReportCommand.OpenFile
                }, CommandVisibility.None);


                
    //更改状态
                designForm.ReportStateChanged += new ReportStateEventHandler(designForm_ReportStateChanged);

                designForm.FormClosing 
    += new FormClosingEventHandler(designForm_FormClosing);

                
    // 加载报表. 
                designForm.OpenReport(r);

                
    // 打开设计器
                designForm.ShowDialog();

                designForm.Dispose();
            }
        }
    }
    ----------------------------------- http://www.cnblogs.com/rock_chen/
  • 相关阅读:
    C#学习教程
    数据库
    读写信号量
    qt配置tensorflow + opencv 提示protoc版本错误
    【1】EIGEN-Matrix类
    c++11的新特性
    ubuntu 16.04 python+tensorflow安装路径查看
    python的常用数据类型及其使用
    windows文件转LINUX文件格式
    ubuntu 16.04 + GPU 1080 + NVIDIA384
  • 原文地址:https://www.cnblogs.com/rock_chen/p/1234103.html
Copyright © 2011-2022 走看看