zoukankan      html  css  js  c++  java
  • 万能打印 下载

    万能打印安装程序下载  链接:http://pan.baidu.com/s/1c28OqFe 密码:bt13

    源码下载  链接:http://pan.baidu.com/s/1c2fIb8s 密码:owvl



    public class PrintHelp { /// <summary> /// 加载打印模板文件方法 /// </summary> /// <param name="ReportPath">模板路径,包括文件名</param> /// <param name="ds">数据源</param> /// <param name="SaveFilePath">编辑模板时保存模板的路径,不包括文件名</param> /// <returns></returns> public static XtraReport ReturnXtraReport(string ReportPath, DataSet ds, string SaveFilePath) { if(ds.Tables.Count<1) { DataTable mfdt = new DataTable(); mfdt.TableName = "mfdt"; DataTable tfdt = new DataTable(); tfdt.TableName = "tfdt"; ds.Tables.Add(mfdt); ds.Tables.Add(tfdt); } XtraReport xtra = XtraReport.FromFile(ReportPath, true); ReportDesignTool dt = new ReportDesignTool(xtra); var designFrom = dt.DesignForm; var mdiController = designFrom.DesignMdiController; dt.DesignForm.DesignMdiController.DesignPanelLoaded += (s, args) => { DesignTool.AddToContainer(args.DesignerHost, ds); }; DevExpress.XtraReports.Native.ReportStorageToolBase.DefaultRootDirectory = SaveFilePath; xtra.DataSource = ds; xtra.DataMember = "mfdt"; return xtra; } /// <summary> /// 加载打印模板文件方法 /// </summary> /// <param name="ReportPath">模板路径,包括文件名</param> /// <param name="ds">数据源</param> /// <param name="SaveFilePath">编辑模板时保存模板的路径,不包括文件名</param> /// <returns></returns> public static XtraReport ReturnNewXtraReport( DataSet ds, string SaveFilePath) { XtraReport xtra = new XtraReport(); ReportDesignTool dt = new ReportDesignTool(xtra); var designFrom = dt.DesignForm; var mdiController = designFrom.DesignMdiController; dt.DesignForm.DesignMdiController.DesignPanelLoaded += (s, args) => { DesignTool.AddToContainer(args.DesignerHost, ds); }; DevExpress.XtraReports.Native.ReportStorageToolBase.DefaultRootDirectory = SaveFilePath; xtra.DataSource = ds; return xtra; } /// <summary> /// 返回主表、明细表 /// </summary> /// <param name="filepath">文件完整路径:含文件名</param> /// <param name="mftablename">主表sheet名称</param> /// <param name="tftablename">从表sheet名称</param> /// <param name="FilesName">两表关联字段</param> /// <returns>DataSet</returns> public static DataSet GetDatase(string filepath, string mftablename, string tftablename, string FilesName) { DataTable mfdt = new DataTable(); DataTable tfdt = new DataTable(); DataSet ds = new DataSet(); ExcelHelp ex = new ExcelHelp(); ex.filePath = filepath;// ex.GetExcelConn(); try { //主表 ex.tableName = mftablename; ex.fileName = "*"; mfdt = ex.GetExcelData(); } finally { if (mfdt == null) { mfdt = new DataTable(); } mfdt.TableName = "mfdt"; ds.Tables.Add(mfdt); } // try { // 从表 ex.tableName = tftablename; ex.fileName = "*"; tfdt = ex.GetExcelData(); } finally { if (tfdt == null) { tfdt = new DataTable(); } tfdt.TableName = "tfdt"; ds.Tables.Add(tfdt); } if (tfdt.Rows.Count > 0 && mfdt.Rows.Count > 0) { //给数据集建立主外键关系 DataColumn parentColumn = ds.Tables["mfdt"].Columns[FilesName]; DataColumn childColumn = ds.Tables["tfdt"].Columns[FilesName]; DataRelation R1 = new DataRelation("R1", parentColumn, childColumn); ds.Relations.Add(R1); } return ds; } /// <summary> /// 获取指定sheet表数据 /// </summary> /// <param name="filepath">Excel路径</param> /// <param name="mftablename">sheet表名称</param> /// <param name="Dttablename">将要给获取的Datatable赋表名(自定义)</param> /// <returns>DataTable</returns> public static DataTable GetDatase(string filepath, string mftablename,string Dttablename) { DataTable mfdt = new DataTable(); ExcelHelp ex = new ExcelHelp(); ex.filePath = filepath;// ex.GetExcelConn(); ex.tableName = mftablename; ex.fileName = "*"; mfdt = ex.GetExcelData(); mfdt.TableName = Dttablename; return mfdt; } }

     

     

     编辑模板

     链接:http://pan.baidu.com/s/1c2wCX80 密码:bddv

  • 相关阅读:
    VR全景项目外包团队— VR/AR相关领域介绍和VR全景案例
    虚拟现实外包公司— VR开发编辑器意义重大 印证VR不仅服务于用户
    全景VR视频游戏外包公司:技术分享使用U3D+CB制作VR游戏
    承接Unity3D外包公司 — 技术分享
    承接cardboard外包,unity3d外包(北京动软— 谷歌CARDBOARD真强大)
    VR外包团队:长年承接VR虚拟现实外包(应用、游戏、视频、漫游等)
    北京全景视频外包公司:长年承接VR全景视频外包
    北京VR视频外包团队:全景VR视频科普
    全景VR视频外包公司:长年承接VR全景视频外包(技术分享YouTube的360全景视频)
    Unity3D外包团队——技术分享U3D全景漫游(三)
  • 原文地址:https://www.cnblogs.com/lanyubaicl/p/7744286.html
Copyright © 2011-2022 走看看