zoukankan      html  css  js  c++  java
  • Developer Express 之 XtraReport报表预览控件PrintControl设置

    Developer Express 之 XtraReport报表预览控件PrintControl设置

     

    代码如下:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using DevExpress.XtraEditors;
    using DevExpress.XtraReports.UI;
    using DevExpress.XtraPrinting.Preview;
    using DevExpress.XtraPrinting;
    using DevExpress.XtraPrinting.Control;
    
    namespace WFAXtraReport
    {
        public partial class Form1 : Form
        {
            public Form1 ()
            {
                InitializeComponent();
            }
    
            private void Form1 _Load(object sender, EventArgs e)
            {
                
                XtraReport fXtraReport = new XtraReport();
                //fXtraReport.LoadLayout(@"C:\1.repx");
    
                PrintControl printControl1 = new PrintControl();
                printControl1.PrintingSystem = fXtraReport.PrintingSystem;
    
    
                PrintBarManager printBarManager = new PrintBarManager();
                printBarManager.Form = printControl1;
                printBarManager.Initialize(printControl1);
                printBarManager.MainMenu.Visible = false;
                printBarManager.AllowCustomization = false;
    
                //操作要显示什么按钮
                printControl1.PrintingSystem.SetCommandVisibility(new PrintingSystemCommand[]{
                    PrintingSystemCommand.Open,
                    PrintingSystemCommand.Save,
                    PrintingSystemCommand.ClosePreview,
                    PrintingSystemCommand.Customize,
                    PrintingSystemCommand.SendCsv,
                    PrintingSystemCommand.SendFile,
                    PrintingSystemCommand.SendGraphic,
                    PrintingSystemCommand.SendMht,
                    PrintingSystemCommand.SendPdf,
                    PrintingSystemCommand.SendRtf,
                    PrintingSystemCommand.SendTxt,
                    PrintingSystemCommand.SendXls
                }, CommandVisibility.None);
    
                fXtraReport.CreateDocument();
    
                Controls.Add(printControl1);
                printControl1.Dock = DockStyle.Fill;
            }
        }
    }

    关于XtraReport的功能还有很多,细节上的处理还有很多,留待以后再整理,先整理这几个常用的。

  • 相关阅读:
    TCP/IP讲解
    Android开发的技术层次
    页面右下角弹出类似QQ或MSN的消息提示
    C# winform 自定义鼠标图标
    C#遍历指定文件夹中的所有文件
    C#操作Word
    关于数据绑定的一些小技巧
    Silverlight遍历本地文件夹
    ckeditor+ckfinder+syntaxhighlight实现上传和插入代码高亮(for .NET)
    wpf 动画效果
  • 原文地址:https://www.cnblogs.com/xiaofengfeng/p/2348484.html
Copyright © 2011-2022 走看看