zoukankan      html  css  js  c++  java
  • DevExpress 常用命令包括导出-打印-打印预览等

    3、表格打印也是最常见的,打印代码如下:

    PrintingSystem ps = null;
    DevExpress.XtraPrinting.PrintableComponentLink link = null;
    ps = new DevExpress.XtraPrinting.PrintingSystem();
    link = new DevExpress.XtraPrinting.PrintableComponentLink(ps);
    ps.Links.Add(link);
    link.Component = gridControl1;//这里可以是可打印的部件
    string _PrintHeader = "打印示例";//标题
    PageHeaderFooter phf = link.PageHeaderFooter as PageHeaderFooter; phf.Header.Content.Clear();
    phf.Header.Content.AddRange(new string[] { "", _PrintHeader, "" });
    phf.Header.Font = new System.Drawing.Font("宋体", 14, System.Drawing.FontStyle.Bold); phf.Header.LineAlignment = BrickAlignment.Center;
    link.CreateDocument(); //建立文档 
    ps.PreviewFormEx.Show();//预览

    4、gridcontrol也可简单的导出excel,代码如下:

    gridControl1.ExportToXls(Application.StartupPath + "\导出示例.xls");
  • 相关阅读:
    Python操作Mongo数据库
    Python正则模块
    Python时间模块
    Python协程(下)
    Python协程(中)
    Python协程(上)
    aiohttp
    常用排序算法的Python实现
    江苏省各地级市58同城租房数据
    百合网
  • 原文地址:https://www.cnblogs.com/wordgao/p/4638046.html
Copyright © 2011-2022 走看看