原創|其它|編輯:郝浩|2012-09-17 14:32:01.000|閱讀 3549 次
概述:本文詳細介紹了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@fc6vip.cn
文章轉載自:轉發