DevExpress打印预览工具自定义

        /// <summary>
        /// 设置Dev控件打印预览界面的工具条
        /// </summary>
        /// <param name="xpt"></param>
        static void SetShowPreviewTools(DevExpress.XtraReports.UI.XtraReport xpt)
        {
            DevExpress.XtraReports.UI.ReportPrintTool mRptPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(xpt);
            xpt.PrintingSystem.SetCommandVisibility(new DevExpress.XtraPrinting.PrintingSystemCommand[] 
                                    { 
                                        DevExpress.XtraPrinting.PrintingSystemCommand.Background , 
                                        DevExpress.XtraPrinting.PrintingSystemCommand.ClosePreview ,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.Customize ,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.DocumentMap ,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.EditPageHF ,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.ExportCsv,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.ExportFile,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.ExportGraphic,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.ExportHtm,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.ExportMht,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.ExportPdf,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.ExportRtf,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.ExportTxt,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.ExportXls,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.ExportXlsx,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.ExportXps,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.File,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.FillBackground ,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.Find,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.HandTool,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.Magnifier,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.MultiplePages,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.Open, 
                                        DevExpress.XtraPrinting.PrintingSystemCommand.PageLayout,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.PageLayoutContinuous,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.PageMargins,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.PageOrientation,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.PageSetup ,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.PaperSize,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.Parameters,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.Pointer,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.Print ,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.PrintDirect ,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.Save,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.SendCsv,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.SendFile,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.SendGraphic,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.SendMht,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.SendPdf,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.SendRtf,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.SendTxt,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.SendXls,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.SendXlsx,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.SendXps,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.SubmitParameters,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.View,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.Watermark
                                    }, DevExpress.XtraPrinting.CommandVisibility.None);
            xpt.PrintingSystem.SetCommandVisibility(new DevExpress.XtraPrinting.PrintingSystemCommand[] 
                                    {
                                        DevExpress.XtraPrinting.PrintingSystemCommand.View,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.Print ,
                                        DevExpress.XtraPrinting.PrintingSystemCommand.PrintDirect
                                    }, DevExpress.XtraPrinting.CommandVisibility.All);
            xpt.ShowPreview();
        }

 

posted on 2013-02-27 16:02  ※WYF※  阅读(5002)  评论(0编辑  收藏  举报