开发者论坛

 找回密码
 注册 (请使用非IE浏览器)
查看: 4804|回复: 0

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

[复制链接]

0

精华

0

贡献

277

赞扬

帖子
184
软币
2067
在线时间
247 小时
注册时间
2014-4-22
发表于 2014-4-22 10:05:49 | 显示全部楼层 |阅读模式
本帖最后由 lmhtingna 于 2014-4-22 10:08 编辑

代码如下:
view sourceprint?
01 using System;
02 using System.Collections.Generic;
03 using System.ComponentModel;
04 using System.Data;
05 using System.Drawing;
06 using System.Text;
07 using System.Windows.Forms;
08 using DevExpress.XtraEditors;
09 using DevExpress.XtraReports.UI;
10 using DevExpress.XtraPrinting.Preview;
11 using DevExpress.XtraPrinting;
12 using DevExpress.XtraPrinting.Control;
13   
14 namespace WFAXtraReport
15 {
16     public partial class Form1 : Form
17     {
18         public Form1 ()
19         {
20             InitializeComponent();
21         }
22   
23         private void Form1 _Load(object sender, EventArgs e)
24         {
25               
26             XtraReport fXtraReport = new XtraReport();
27             //fXtraReport.LoadLayout(@"C:\1.repx");
28   
29             PrintControl printControl1 = new PrintControl();
30             printControl1.PrintingSystem = fXtraReport.PrintingSystem;
31   
32   
33             PrintBarManager printBarManager = new PrintBarManager();
34             printBarManager.Form = printControl1;
35             printBarManager.Initialize(printControl1);
36             printBarManager.MainMenu.Visible = false;
37             printBarManager.AllowCustomization = false;
38   
39             //操作要显示什么按钮
40             printControl1.PrintingSystem.SetCommandVisibility(new PrintingSystemCommand[]{
41                 PrintingSystemCommand.Open,
42                 PrintingSystemCommand.Save,
43                 PrintingSystemCommand.ClosePreview,
44                 PrintingSystemCommand.Customize,
45                 PrintingSystemCommand.SendCsv,
46                 PrintingSystemCommand.SendFile,
47                 PrintingSystemCommand.SendGraphic,
48                 PrintingSystemCommand.SendMht,
49                 PrintingSystemCommand.SendPdf,
50                 PrintingSystemCommand.SendRtf,
51                 PrintingSystemCommand.SendTxt,
52                 PrintingSystemCommand.SendXls
53             }, CommandVisibility.None);
54   
55             fXtraReport.CreateDocument();
56   
57             Controls.Add(printControl1);
58             printControl1.Dock = DockStyle.Fill;
59         }
60     }
61 }
关于XtraReport的功能还有很多,细节上的处理还有很多,留待以后再整理,先整理这几个常用的
回复

使用道具 举报

Archiver|手机版|小黑屋|开发者网 ( 苏ICP备08004430号-2 )
版权所有:南京韵文教育信息咨询有限公司

GMT+8, 2025-2-23 14:19

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表