世俱杯 2025

DevExpress之XtraReport报表预览控件PrintControl设置

原创|其它|编辑:郝浩|2012-09-17 14:32:01.000|阅读 3527 次

概述:本文详细介绍了DevExpress的XtraReport报表预览控件PrintControl设置。

# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>

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;
}
}
}
关于XtraReports的功能还有很多,细节上的处理还有很多,留待以后再整理,先整理这几个常用的。



标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@dpuzeg.cn

文章转载自:转发

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
相关产品
XtraReports Suite

针对Windows Forms、ASP.NET、ASP.NET MVC、WPF,Silverlight和LightSwitch开发者的下一代跨平台报表方案

DevExpress Universal Subscription

优秀的界面控件开发包,帮助企业构建卓越应用!

DevExpress WPF Subscription

高效MVVM开发模式,WPF界面解决方案首选工具,帮助企业实现酷炫动效界面。

DevExpress Silverlight Controls

高性价比高实用性的Silverlight用户界面控件套包,拥有大量的示例和帮助文档,开发者能够快速上手!

DevExpress WinForms Subscription

为Windows Forms平台创建具有影响力的业务解决方案,高性价比WinForms界面控件套包。

title
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP