www.pudn.com > DevPrintReport.rar > Dev_ӡ.cs, change:2011-05-06,size:3131b


using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Text; 
using System.Windows.Forms; 
using DevExpress.XtraReports.UI; 
using DevExpress.XtraPrinting; 
 
namespace TZL_Print 
{ 
    public partial class Dev_打印 : publicControl.ImeXtraForm 
    { 
        string uc_类名 = ""; 
        DataSet DataS_打印 = new DataSet(); 
        public Dev_打印(ref DataSet ds, string uc_name) 
            : this() 
        { 
            DataS_打印 = ds; 
            uc_类名 = uc_name; 
        } 
 
 
        public Dev_打印() 
        { 
            InitializeComponent(); 
            printBarManager1.Form = printControl1; 
            printBarManager1.Initialize(printControl1); 
            printBarManager1.MainMenu.Visible = false; 
            printBarManager1.AllowCustomization = false; 
            //this.printControl1.PrintingSystem = fReport.PrintingSystem; 
        } 
        XtraReport1 report = new XtraReport1(); 
        private void Dev_打印_Load(object sender, EventArgs e) 
        { 
            //DataTable dt = DataS_打印.Tables[1]; 
            report = new XtraReport1(ref DataS_打印, uc_类名, 1); 
            //report = new XtraReport1(ref DataS_打印, uc_类名, 0); 
            //DxperienceXtraPrintingLocalizationCHS. 
            //report.ptype = 1; 
            //report.DataSource = DataS_打印.Tables[1]; 
            //report.DataMember = "尺码"; 
            //report.ShowPreview(); 
 
            //printingSystem1 = report.PrintingSystem; 
            this.printControl1.PrintingSystem = report.PrintingSystem; 
            //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); 
 
            report.CreateDocument(); 
            //report.PrintingSystem = this.printControl1.PrintingSystem; 
        } 
 
 
        internal void Form打印(ref DataSet Data, string Classname) 
        { 
            if (report != null) 
                report.CreateReport(ref Data, uc_类名, 1); 
            else 
                report = new XtraReport1(ref Data, uc_类名, 1); 
            this.printControl1.PrintingSystem = report.PrintingSystem; 
            report.CreateDocument(); 
        } 
 
        private void Dev_打印_FormClosing(object sender, FormClosingEventArgs e) 
        { 
            this.Visible = false; 
            e.Cancel = true; 
        } 
    } 
}