前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >dev GridControl直接打印 纵向合并单元格

dev GridControl直接打印 纵向合并单元格

作者头像
乔达摩@嘿
发布2020-09-11 15:25:12
1.4K0
发布2020-09-11 15:25:12
举报
文章被收录于专栏:嘿dotNet嘿dotNet

GridControl纵向合并单元格

只需设置 gridView->OptionView->AllowCellMerge=true;

效果

提示:

精确到列 前提是gridview1已经允许合并单元格(内容相同的才合并)

this.gridView1.Columns["班组"].OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.True;

gridControl直接打印:

代码语言:javascript
复制
 public static void reportPrint(GridControl gridControl1,string title)
        {
            //PrintingSystem printingSystem1 = new PrintingSystem();
            //PrintableComponentLink printableComponentLink1 = new PrintableComponentLink();
            //// Add the link to the printing system's collection of links.
            //printingSystem1.Links.AddRange(new object[] { printableComponentLink1 });
            //// Assign a control to be printed by this link.
            //printableComponentLink1.Component = gridControl1;
            //// Set the paper orientation to Landscape.
            //printableComponentLink1.Landscape = false;
            ////show预览
            // printableComponentLink1.ShowPreview();
            //直接打印
           // printableComponentLink1.PrintDlg();
            
            PrintingSystem print = new DevExpress.XtraPrinting.PrintingSystem();
            PrintableComponentLink link = new PrintableComponentLink(print);
            print.Links.Add(link);
            link.Component = gridControl1;//这里可以是可打印的部件
            string _PrintHeader = title;
            PageHeaderFooter phf = link.PageHeaderFooter as PageHeaderFooter;
            //link.RtfReportHeader = "我是报表头";
            //link.RtfReportFooter = "我是报表尾部";
            link.PaperKind = System.Drawing.Printing.PaperKind.A4Plus; //设置纸张
            link.Landscape = false; //mh
            phf.Header.Content.Clear();
            phf.Header.Content.AddRange(new string[] { "", _PrintHeader, "" });
            phf.Header.Font = new System.Drawing.Font("宋体", 16, System.Drawing.FontStyle.Bold);
            phf.Header.LineAlignment = BrickAlignment.Center;
            link.CreateDocument(); //建立文档
            link.ShowPreviewDialog();
            //  print.PreviewFormEx.Show();//进行预览 非模式窗体
            //直接打印
            // print.PrintDlg();
        }

以上代码自己找的 可行

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2014-12-12 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
腾讯云 BI
腾讯云 BI(Business Intelligence,BI)提供从数据源接入、数据建模到数据可视化分析全流程的BI能力,帮助经营者快速获取决策数据依据。系统采用敏捷自助式设计,使用者仅需通过简单拖拽即可完成原本复杂的报表开发过程,并支持报表的分享、推送等企业协作场景。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档