• devexpress打印gridControl


    //不显示表头设置
     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
    这样打印出来就不会显示列名了。
  • 相关阅读:
    Reverse题的tips
    电子公文传输系统 团队作业(五):冲刺总结(第三天)
    webrtc sdp(会话传输协议)详解
    CentOS新系统开启网络
    FreeSWITCH Cookbook
    NetEngine AR V300R019 配置指南-IP业务(命令行)—— NAT
    将md(markdown)文件导出成pdf的最简单办法
    liblinear
    Accelerometer, Gyroscope, and Magnetometer Analysis with Matplotlib
    svmlight
  • 原文地址:https://www.cnblogs.com/Anders888/p/12623815.html
Copyright © 2020-2023  润新知