资源预览内容
第1页 / 共11页
第2页 / 共11页
第3页 / 共11页
第4页 / 共11页
第5页 / 共11页
第6页 / 共11页
第7页 / 共11页
第8页 / 共11页
第9页 / 共11页
第10页 / 共11页
亲,该文档总共11页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
Xtrareport1, 此报表在设置时,paperkind中找不到自定义的纸张,所以我就在事件beforeprint中,this.Margins = new System.Drawing.Printing.Margins(10, 10, 10, 10); this.PaperKind = System.Drawing.Printing.PaperKind.Custom; this.PageWidth = 827; this.PageHeight = 584; this.PaperName = 21*132.加载已有模板xrpt1.LoadLayout(E:EMS.repx);Developer Express 之 XtraReport报表预览控件PrintControl设置usingSystem;02usingSystem.Collections.Generic;03usingSystem.ComponentModel;04usingSystem.Data;05usingSystem.Drawing;06usingSystem.Text;07usingSystem.Windows.Forms;08usingDevExpress.XtraEditors;09usingDevExpress.XtraReports.UI;10usingDevExpress.XtraPrinting.Preview;11usingDevExpress.XtraPrinting;12usingDevExpress.XtraPrinting.Control;1314namespaceWFAXtraReport1516publicpartialclassForm1 : Form1718publicForm1 ()1920InitializeComponent();212223privatevoidForm1 _Load(objectsender, EventArgs e)242526XtraReport fXtraReport =newXtraReport();27/fXtraReport.LoadLayout(C:1.repx);2829PrintControl printControl1 =newPrintControl();30printControl1.PrintingSystem = fXtraReport.PrintingSystem;313233PrintBarManager printBarManager =newPrintBarManager();34printBarManager.Form = printControl1;35printBarManager.Initialize(printControl1);36printBarManager.MainMenu.Visible =false;37printBarManager.AllowCustomization =false;3839/操作要显示什么按钮40printControl1.PrintingSystem.SetCommandVisibility(newPrintingSystemCommand41PrintingSystemCommand.Open,42PrintingSystemCommand.Save,43PrintingSystemCommand.ClosePreview,44PrintingSystemCommand.Customize,45PrintingSystemCommand.SendCsv,46PrintingSystemCommand.SendFile,47PrintingSystemCommand.SendGraphic,48PrintingSystemCommand.SendMht,49PrintingSystemCommand.SendPdf,50PrintingSystemCommand.SendRtf,51PrintingSystemCommand.SendTxt,52PrintingSystemCommand.SendXls53, CommandVisibility.None);5455fXtraReport.CreateDocument();5657Controls.Add(printControl1);58printControl1.Dock = DockStyle.Fill;596061关于XtraReport的功能还有很多,细节上的处理还有很多,留待以后再整理,先整理这几个常用的。posted 2010-12-06 21:10 CookBlack 阅读(423) | 评论(0) |编辑Developer Express 之 XtraReport如何显示设计窗体XtraReport的设计器,其实用XRDesignFormEx就可以。01usingSystem;02usingSystem.Collections.Generic;03usingSystem.ComponentModel;04usingSystem.Data;05usingSystem.Drawing;06usingSystem.Linq;07usingSystem.Text;08usingSystem.Windows.Forms;09usingDevExpress.XtraReports.UI;10usingDevExpress.XtraReports.UserDesigner;11usingSystem.Drawing.Design;12usingSystem.ComponentModel.Design;1314namespaceWFAXtraReport1516publicpartialclassForm1 : Form1718XtraReport r ;/这个可以是加载之前设计好的模板19publicForm1()2021InitializeComponent();222324privatevoiddesignForm_FormClosing(objectsender, FormClosingEventArgs e)2526/在此处处理关闭设计器时的操作,主要用来自定义保存数据27/r.SaveLayout(C:1.repx);282930privatevoiddesignForm_ReportStateChanged(objectsender, ReportStateEventArgs e)3132/只要报表发生改变就立即将状态设置为保存33/避免系统默认保存对话框的出现34if(e.ReportState = ReportState.Changed)3536(XRDesignFormEx)sender).DesignPanel.ReportState = ReportState.Saved;37383940privatevoidForm1_Load(objectsender, EventArgs e)4142r =newXtraReport();43/r.LoadLayout(C:1.repx);44XRDesignFormEx designForm =newXRDesignFormEx();4546/隐藏按钮47designForm.DesignPanel.SetCommandVisibility(newReportCommand48ReportCommand.NewReport,49ReportCommand.SaveFileAs,50ReportCommand.NewReportWizard,51ReportCommand.OpenFile52, CommandVisibility.None);535455/更改状态56designForm.ReportStateChanged +=newReportStateEventHandler(designForm_ReportStateChanged);5758designForm.FormClosing +=newFormClosingEvent
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号