xtrareport 的使用方法 下载本文

内容发布更新时间 : 2024/7/4 13:19:55星期一 下面是文章的全部内容请认真阅读。

Xtrareport

1, 此报表在设置时,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 = \2.加载已有模板

xrpt1.LoadLayout(@\);

Developer Express 之 XtraReport报表预览控件PrintControl设置 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(@\28

29 PrintControl printControl1 = new PrintControl(); printControl1.PrintingSystem = 30

fXtraReport.PrintingSystem; 31 32

PrintBarManager printBarManager 33

= new PrintBarManager(); 34 printBarManager.Form = printControl1; 35 printBarManager.Initialize(printControl1); 36 printBarManager.MainMenu.Visible = false; 37 printBarManager.AllowCustomization = false; 38

39 //操作要显示什么按钮

4 printControl1.PrintingSystem.SetCommandVisibility(new P0 rintingSystemCommand[]{

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

posted @ 2010-12-06 21:10 CookBlack 阅读(423) | 评论(0) | 编辑

Developer Express 之 XtraReport如何显示设计窗体 XtraReport的设计器,其实用XRDesignFormEx就可以。

01 using System;

02 using System.Collections.Generic; 03 using System.ComponentModel; 04 using System.Data; 05 using System.Drawing; 06 using System.Linq; 07 using System.Text;

08 using System.Windows.Forms; 09 using DevExpress.XtraReports.UI;

10 using DevExpress.XtraReports.UserDesigner; 11 using System.Drawing.Design; 12 using System.ComponentModel.Design; 13

14 namespace WFAXtraReport 15 {

16 public partial class Form1 : Form 17 {

18 XtraReport r ;//这个可以是加载之前设计好的模板 19 public Form1() 20 {

21 InitializeComponent(); 22 } 23

24 private void designForm_FormClosing(object sender,