码迷,mamicode.com
首页 > 其他好文 > 详细

devexpress打印gridControl

时间:2020-04-03 00:26:28      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:trap   component   lse   rev   显示   assign   style   range   进入   

//不显示表头设置
 gridView1.OptionsView.ShowGroupPanel = false;
gridView1.OptionsView.ShowColumnHeaders = false;

//如果打印预览的话(支持多组件打印)
PrintingSystem printingSystem1 = new PrintingSystem();
            printingSystem1.StartPrint += new DevExpress.XtraPrinting.PrintDocumentEventHandler(PrintingSystem_StartPrint);
            PrintableComponentLink printableComponentLink1 = new PrintableComponentLink();

            printingSystem1.Links.AddRange(new object[] { printableComponentLink1 });
            // Assign a control to be printed by this link.
            gridView1.OptionsView.ShowColumnHeaders = false;
            //gridControl1.Views[0].op
            printableComponentLink1.Component = gridControl1;
            printableComponentLink1.Landscape = true;
            //printableComponentLink1.CreateMarginalHeaderArea += new CreateAreaEventHandler(myEvent_CreateMarginalHeaderArea);

            //显示打印预览
            //printableComponentLink1.ShowPreview();

            CompositeLink compositeLink = new CompositeLink(new PrintingSystem());
            compositeLink.CreateMarginalHeaderArea += new CreateAreaEventHandler(myEvent_CreateMarginalHeaderArea);
            compositeLink.CreateReportHeaderArea += new CreateAreaEventHandler(myEvent_CreateReportHeaderArea);
            compositeLink.Links.Add(printableComponentLink1);
            compositeLink.ShowPreview();

//gridControl在打印预览时,如果不需要显示列名
进入设计器Run Designer并且在OptionsPrint组属性中设置PrintDetails = True, PrintHeader = False
这样打印出来就不会显示列名了。

 

devexpress打印gridControl

标签:trap   component   lse   rev   显示   assign   style   range   进入   

原文地址:https://www.cnblogs.com/Anders888/p/12623815.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!