示例#1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ucSelectCondition1_ExportEvent(object sender, EventArgs e)
 {
     string filename = Xdgk.Common.Path.GetTempFileName("xls");
     //Xdgk.Common.Export.ExcelExporter ee = new Xdgk.Common.Export.ExcelExporter(filename);
     //ee.Export(this.dataGridView1);
     DataFormatterCollection dfs = new DataFormatterCollection();
     dfs.Add(new SingleFormatter());
     dfs.Add(new Int32Formatter());
     dfs.Add(new DoubleFormatter());
     Xdgk.Common.Export.Exporter.Export(filename, this.dataGridView1, dfs, true);
 }
示例#2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ucCalcHeatCondition1_ExportEvent(object sender, EventArgs e)
        {
            string filename = CZGRCommon.Path.GetTempFileName("xls");
            DataFormatterCollection dfs = new DataFormatterCollection();
            dfs.Add(new SingleFormatter());
            dfs.Add(new DoubleFormatter());
            dfs.Add(new Int32Formatter());
            CZGRCommon.ExcelExporter ee = new CZGRCommon.ExcelExporter(filename, dfs);

            // 耗热量计算公式
            //
            LinesAttache aaa = new LinesAttache();
            DataTable tbl = CZGRQRCApp.Default.DBI.ExecuteHeatCommentDataTable();
            List<III> iiis = CreateIIIs();
            CZGRCommon.CCC ccc = CreateCCC(iiis);

            aaa.Lines.Add("");
            aaa.Lines.Add("注:");

            foreach (DataRow row in tbl.Rows)
            {
                string content = row["content"].ToString().Trim();
                if (content.Length > 0)
                {
                    aaa.Lines.Add(content);
                }
            }
            //aaa.Lines.Add("\t注:日耗热量 = 日流量 * ( 一次供温 - 一次回温 ) * 4.1816 / 1000");

            ee.AttacheCollection.Add(aaa);

            ee.Export(this.dataGridView1, ccc);

            ProcessStartInfo si = new ProcessStartInfo(filename);
            si.ErrorDialog = true;
            Process.Start(si);
        }
示例#3
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private DataFormatterCollection GetDataFormatterCollection()
        {
            DataFormatterCollection s = new DataFormatterCollection();
            s.Add(new SingleFormatter());
            s.Add(new Int32Formatter());

            //s.Add();
            return s;
        }