C#巧用Excel模版变成把Table打字与印刷出来

转载:http://blog.csdn.net/gwblue/article/details/38865525

将一个搞好的Excel模版,通进程序填上数据然后打印出来这几个供给有三种艺术壹种是透过代码打开Excel模版然后填入数据然后再打印。

第二种艺术正是自个儿快要介绍的

一、将Excel设置好格式另存为HTML页将Excel转化为HTML的Table

C# 1

二、将HTML用记事本打开把这么些HTML页将<style></style>和<table></table>标签中的内容粘贴出来。

叁、在程序中写入打字与印刷代码。

 

[java] view
plain
copyC# 2C# 3

  1. using System;  
  2. using System.Collections.Generic;  
  3.   
  4. using System.Web;  
  5. using System.Web.UI;  
  6. using System.Web.UI.WebControls;  
  7. using System.Text;  
  8. using System.IO;  
  9. using BLL;  
  10. using Model;  
  11. using System.Data;  
  12.   
  13. public partial class WebUI_Order_OutExcel : System.Web.UI.Page  
  14. {  
  15.     BT_XDMgr XDMgr = new BT_XDMgr();  
  16.     DataTable dtOrderMainInfo = new DataTable();  
  17.     DataTable dtOrderCongInfo = new DataTable();  
  18.     protected void Page_Load(object sender, EventArgs e)  
  19.     {  
  20.   
  21.         if (Request.QueryString[“OrderID”] != null && Request.QueryString[“CKFromID”] != null)  
  22.                 {  
  23.                     int OrderID =Convert.ToInt32( Request.QueryString[“OrderID”].ToString().Trim());  
  24.                     int CKFromID = Convert.ToInt32(Request.QueryString[“CKFromID”].ToString().Trim());  
  25.                     string strWhere = ” and T_DLS_Order_CKFrom.OrderID=” + OrderID;  
  26.                     dtOrderMainInfo = XDMgr.CKList(strWhere);  
  27.                     dtOrderCongInfo = XDMgr.QueryCKCongInfobyCKFromID(CKFromID);  
  28.                
  29.                     string strText = getExcelContent(dtOrderMainInfo,dtOrderCongInfo);  
  30.                     ExportExcel(this, “出库单表”, strText);  
  31.                 }  
  32.          
  33.     }  
  34.   
  35.   
  36.   
  37.       
  38.   
  39.     /// <summary>  
  40.     /// 导出Excel  
  41.     /// </summary>  
  42.     /// <param name=”page”>操作页面</param>  
  43.     /// <param name=”fileName”>导出的文件名称</param>  
  44.     /// <param name=”text”>要导出的始末</param>  
  45.     public void ExportExcel(Page page, string fileName, string text)  
  46.     {  
  47.         page.EnableViewState = false;  
  48.         try  
  49.         {  
  50.             page.Response.ClearContent();  
  51.             page.Response.Buffer = true;  
  52.             page.Response.Charset = “GB2312”;//设置字符集,化解中文乱码难点  
  53.             page.Response.ContentEncoding = System.Text.Encoding.GetEncoding(“GB2312”);  
  54.             page.Response.Write(“<meta http-equiv=Content-Type content=\”text/html;charset=GB2312\”>”);//解决乱码难题  
  55.         
  56.             ////解决HTTP头粤语乱码难题  
  57.             //string strExcelText = fileName;//Excel显示的始末  
  58.             //string strEncode = System.Web.HttpUtility.UrlEncode(strExcelText, System.Text.Encoding.UTF八);//实行编码的格式,用gb231二出错  
  59.             //page.Response.AddHeader(“content-disposition”, “attachment;filename=\”” + strEncode + “.xls\””);//对封存标题举办编码  
  60.             //page.Response.ContentType = “application/excel”;//设置输出格式  
  61.             //page.Response.Write(getStyle());  
  62.             StringWriter sw = new StringWriter();  
  63.             HtmlTextWriter htw = new HtmlTextWriter(sw);  
  64.             htw.WriteLine(text);//将数据输出  
  65.             page.Response.Write(sw.ToString());  
  66.             //page.Response.Write(“</body></html>”);  
  67.             page.Response.Flush();  
  68.             page.Response.End();  
  69.         }  
  70.         catch  
  71.         {  
  72.             return;  
  73.         }  
  74.         finally  
  75.         {  
  76.             //复苏原来控件内容  
  77.             page.EnableViewState = true;  
  78.         }  
  79.     }  
  80.   
  81.   
  82.     //订单新闻  
  83.     private string getExcelContent(DataTable dtMainInfo,DataTable dtCongInfo)  
  84.     {  
  85.         StringBuilder strExcel = new StringBuilder();  
  86.         //Table的样式  
  87.         strExcel.Append(@”<html><head><style>”);  
  88.         strExcel.Append(” table{mso-displayed-decimal-separator:’\\.\’;mso-displayed-thousand-separator:’\\,\’;}”);  
  89.         strExcel.Append(” .font56428{color:windowtext;font-size:9.0pt; font-weight:400;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;}”);  
  90.         strExcel.Append(” .xl156428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:11.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:general;vertical-align:middle;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  91.         strExcel.Append(” .xl676428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:10.0pt;font-weight:700;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:center;vertical-align:middle;border:.5pt solid windowtext;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  92.         strExcel.Append(” .xl686428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:12.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:general;vertical-align:bottom;border:.5pt solid windowtext;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  93.         strExcel.Append(” .xl696428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:12.0pt;font-weight:700;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:general;vertical-align:middle;border:.5pt solid windowtext;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  94.         strExcel.Append(” .xl706428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:10.0pt;font-weight:700;font-style:normal;text-decoration:none;font-family:’Times New Roman’, serif;mso-font-charset:0;mso-number-format:General;text-align:center;vertical-align:bottom;border:.5pt solid windowtext;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  95.         strExcel.Append(” .xl716428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:12.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:general;vertical-align:middle;border:.5pt solid windowtext;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  96.         strExcel.Append(” .xl726428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:14.0pt;font-weight:700;font-style:normal;text-decoration:none;font-family:’Times New Roman’, serif;mso-font-charset:0;mso-number-format:General;text-align:general;vertical-align:bottom;border:.5pt solid windowtext;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  97.         strExcel.Append(” .xl736428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:14.0pt;font-weight:700;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:center;vertical-align:middle;border:.5pt solid windowtext;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  98.         strExcel.Append(” .xl746428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:14.0pt;font-weight:700;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:right;vertical-align:middle;border:.5pt solid windowtext;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  99.         strExcel.Append(” .xl756428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:14.0pt;font-weight:700;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:center;vertical-align:middle;border:.5pt solid windowtext;background:white;mso-pattern:black none;white-space:nowrap;}”);  
  100.         strExcel.Append(” .xl766428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:14.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:center;vertical-align:middle;border:.5pt solid windowtext;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  101.         strExcel.Append(” .xl776428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:18.0pt;font-weight:700;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:center;vertical-align:bottom;border:.5pt solid windowtext;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  102.         strExcel.Append(” .xl786428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:14.0pt;font-weight:700;font-style:normal;text-decoration:none;font-family:’Times New Roman’, serif;mso-font-charset:0;mso-number-format:General;text-align:right;vertical-align:middle;border:.5pt solid windowtext;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  103.         strExcel.Append(” .xl796428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:14.0pt;font-weight:700;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:general;vertical-align:middle;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  104.         strExcel.Append(” .xl806428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:14.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:general;vertical-align:middle;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  105.         strExcel.Append(” .xl816428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:11.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:center;vertical-align:middle;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  106.         strExcel.Append(” .xl826428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:14.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:left;vertical-align:bottom;border:.5pt solid windowtext;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  107.         strExcel.Append(” .xl836428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:14.0pt;font-weight:700;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:left;vertical-align:middle;border:.5pt solid windowtext;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  108.         strExcel.Append(” .xl846428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:14.0pt;font-weight:700;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:left;vertical-align:middle;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  109.         strExcel.Append(” .xl856428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:11.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:left;vertical-align:middle;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  110.         strExcel.Append(” .xl866428{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:windowtext;font-size:12.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:宋体;mso-generic-font-family:auto;mso-font-charset:134;mso-number-format:General;text-align:left;vertical-align:middle;border:.5pt solid windowtext;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}”);  
  111.         strExcel.Append(“</style>”);  
  112.         //Javascript的打印代码  
  113.         strExcel.Append(“<script type=’text/javascript’>”);  
  114.          strExcel.Append(“function doPrint() {“);  
  115. C#,         strExcel.Append(“var htmlcode=window.document.body.innerHTML;”);  
  116.          strExcel.Append(“var sprnstr='<!–startprint–>’;”);  
  117.          strExcel.Append(“var eprnstr= ‘<!–endprint–>’;”);  
  118.          strExcel.Append(“var prnhtml=htmlcode.substr(htmlcode.indexOf(sprnstr)+17);”);  
  119.          strExcel.Append(“prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));”);  
  120.          strExcel.Append(“window.document.body.innerHTML=prnhtml;”);  
  121.          strExcel.Append(“window.print();”);  
  122.          strExcel.Append(“window.document.body.innerHTML=htmlcode;”);    
  123.          strExcel.Append(“}”);  
  124.          strExcel.Append(“</script>”);  
  125.          strExcel.Append(“</head><body ><input id=’Button1′ type=’button’ value=’打印’  onclick=’doPrint()’ target=’_self’/>”);  
  126.        strExcel.Append(“<!–startprint–> <center>”);  
  127.        strExcel.Append(“<table border=0 cellpadding=0 cellspacing=0 width=795 style=’border-collapse:”);  
  128.           strExcel.Append(“collapse;table-layout:fixed;width:598pt’>”);  
  129.           strExcel.Append(“<col class=xl856428 width=170 style=’mso-width-source:userset;mso-width-alt:”);  
  130.           strExcel.Append(“5440;width:128pt’>”);  
  131.          strExcel.Append(” <col width=190 style=’mso-width-source:userset;mso-width-alt:6080;width:143pt’>”);  
  132.           strExcel.Append(“<col width=93 style=’mso-width-source:userset;mso-width-alt:2976;width:70pt’>”);  
  133.           strExcel.Append(“<col width=89 style=’mso-width-source:userset;mso-width-alt:2848;width:67pt’>”);  
  134.           strExcel.Append(“<col width=131 style=’mso-width-source:userset;mso-width-alt:4192;width:98pt’>”);  
  135.           strExcel.Append(“<col width=122 style=’mso-width-source:userset;mso-width-alt:3904;width:92pt’>”);  
  136.           strExcel.Append(“<tr height=30 style=’height:22.5pt’>”);  
  137.            strExcel.Append(“<td colspan=6 height=30 class=xl776428 width=795 style=’height:22.5pt;”);  
  138.            strExcel.Append(“width:598pt’>出库单</td>”);  
  139.            strExcel.Append(“</tr>”);  
  140.            strExcel.Append(“<tr height=22 style=’mso-height-source:userset;height:16.5pt’>”);  
  141.           strExcel.Append(“<td height=22 class=xl826428 style=’height:16.5pt;border-top:none’> </td>”);  
  142.           strExcel.Append(“<td class=xl726428 style=’border-top:none;border-left:none’> </td>”);  
  143.           strExcel.Append(“<td class=xl726428 style=’border-top:none;border-left:none’> </td>”);  
  144.           strExcel.Append(“<td class=xl786428 style=’border-top:none;border-left:none’>NO.</td>”);  
  145.           strExcel.Append(“<td colspan=2 class=xl706428 style=’border-left:none’> ”+dtMainInfo.Rows[0][“OrderCode”].ToString().Trim()+”</td>”);  
  146.           strExcel.Append(“</tr>”);  
  147.         strExcel.Append(“<tr height=25 style=’height:22pt’>”);  
  148.         strExcel.Append(“<td height=贰5 class=xl83642八 style=’height:2二pt;border-top:none’>购货单位</td>”);  
  149.          strExcel.Append(“<td class=xl676428 style=’border-top:none;border-left:none’>”+dtMainInfo.Rows[0][“Company”].ToString().Trim()+”</td>”);  
  150.          strExcel.Append(“<td class=xl73642捌 style=’border-top:none;border-left:none’>制单日期</td>”);  
  151.          strExcel.Append(“<td class=xl686428 style=’border-top:none;border-left:none; vertical-align:middle;’>” + DateTime.Now.ToShortDateString() + “</td>”);  
  152.          strExcel.Append(“<td class=xl73642捌 style=’border-top:none;border-left:none’>出库日期</td>”);  
  153.          strExcel.Append(“<td class=xl696428 style=’border-top:none;border-left:none’> </td>”);  
  154.          strExcel.Append(“</tr>”);  
  155.         strExcel.Append(”  <tr height=25 style=’height:18.75pt’>”);  
  156.        strExcel.Append(” <td height=二5 class=xl73642八 style=’height:1捌.7伍pt;border-top:none’>物料编码</td>”);  
  157.        strExcel.Append(” <td class=xl73642八 style=’border-top:none;border-left:none’>物料描述</td>”);  
  158.        strExcel.Append(” <td class=xl736428 style=’border-top:none;border-left:none’>数量</td>”);  
  159.        strExcel.Append(” <td class=xl736428 style=’border-top:none;border-left:none’>单价</td>”);  
  160.        strExcel.Append(” <td class=xl736428 style=’border-top:none;border-left:none’>金额</td>”);  
  161.        strExcel.Append(” <td class=xl736428 style=’border-top:none;border-left:none’>小计</td>”);  
  162.        strExcel.Append(” </tr>”);  
  163.              if (dtCongInfo.Rows.Count > 0)  
  164.                 {  
  165.                     for (int i = 0; i < dtCongInfo.Rows.Count; i++)  
  166.                     {  
  167.   
  168.                         strExcel.Append(“<tr height=30 style=’mso-height-source:userset;height:22.5pt;text-align:center;’>”);  
  169.                         strExcel.Append(“<td height=30 class=xl866428 style=’height:22.5pt;border-top:none;text-align:center;’>” + dtCongInfo.Rows[i][“SJWLBM”].ToString().Trim() + “</td>”);  
  170.               strExcel.Append(“<td class=xl716428 style=’border-top:none;border-left:none’>” + dtCongInfo.Rows[i][“LJMC”].ToString().Trim() + “</td>”);  
  171.               strExcel.Append(“<td class=xl716428 style=’border-top:none;border-left:none’>” + ((dtCongInfo.Rows[i][“SFNumber”] == null) ? “0” : dtCongInfo.Rows[i][“SFNumber”].ToString().Trim()) + “</td>”);  
  172.               strExcel.Append(“<td class=xl716428 style=’border-top:none;border-left:none’>” + ((dtCongInfo.Rows[i][“LJDJ”] == null) ? “0” : dtCongInfo.Rows[i][“LJDJ”].ToString().Trim()) + “</td>”);  
  173.               strExcel.Append(“<td class=xl716428 style=’border-top:none;border-left:none’>” + ((dtCongInfo.Rows[i][“Money”] == null) ? “0” : dtCongInfo.Rows[i][“Money”].ToString().Trim()) + “</td>”);  
  174.               strExcel.Append(“<td class=xl716428 style=’border-top:none;border-left:none’> </td>”);  
  175.               strExcel.Append(“</tr>”);  
  176.                     }  
  177.                 }  
  178.         strExcel.Append(“<tr height=25 style=’height:18.75pt’>”);  
  179.          strExcel.Append(” <td colspan=5 height=二伍 class=xl74642八 style=’height:1八.7伍pt’>金额合计:</td>”);  
  180.          strExcel.Append(“<td class=xl716428 style=’border-top:none;border-left:none’>” + ((dtMainInfo.Rows[0][“Money”] == null) ? “0” : dtMainInfo.Rows[0][“Money”].ToString().Trim()) + “</td>”);  
  181.           strExcel.Append(“</tr>”);  
  182.           strExcel.Append(“<tr class=xl816428 height=25 style=’height:18.75pt’>”);  
  183.        strExcel.Append(“<td height=25 class=xl736428 style=’height:18.75pt;border-top:none’>合 同 号</td>”);  
  184.        strExcel.Append(“<td class=xl766428 style=’border-top:none;border-left:none’> </td>”);  
  185.        strExcel.Append(“<td class=xl736428 style=’border-top:none;border-left:none’>移库类型</td>”);  
  186.        strExcel.Append(“<td class=xl766428 style=’border-top:none;border-left:none’> </td>”);  
  187.        strExcel.Append(“<td class=xl75642八 style=’border-top:none;border-left:none’>耗费化凭证号</td>”);  
  188.        strExcel.Append(“<td class=xl766428 style=’border-top:none;border-left:none’>” + ((dtMainInfo.Rows[0][“FYHPZH”] == null) ? “0” : dtMainInfo.Rows[0][“FYHPZH”].ToString().Trim()) + “</td>”);  
  189.       strExcel.Append(“</tr>”);  
  190.    strExcel.Append(“<tr class=xl816428 height=25 style=’height:18.75pt’>”);  
  191.     strExcel.Append(“<td height=2五 class=xl83642八 style=’height:1八.7五pt;border-top:none’>发货格局</td>”);  
  192.     strExcel.Append(“<td class=xl756428 style=’border-top:none;border-left:none’>转库凭证号</td>”);  
  193.     strExcel.Append(“<td class=xl766428 style=’border-top:none;border-left:none’>” + ((dtMainInfo.Rows[0][“ZKPZH”] == null) ? “0” : dtMainInfo.Rows[0][“ZKPZH”].ToString().Trim()) + “</td>”);  
  194.     strExcel.Append(“<td class=xl736428 style=’border-top:none;border-left:none’>备注</td>”);  
  195.     strExcel.Append(“<td colspan=2 class=xl766428 style=’border-left:none’> </td>”);  
  196.     strExcel.Append(“</tr>”);  
  197.    strExcel.Append(“<tr height=25 style=’height:18.75pt’>”);  
  198.    strExcel.Append(“<td height=25 class=xl846428 style=’height:18.75pt’>制单:</td>”);  
  199.    strExcel.Append(“<td class=xl79642捌>售后审结:</td>”);  
  200.    strExcel.Append(“<td class=xl79642八 colspan=二>储存运输审核:</td>”);  
  201.    strExcel.Append(“<td class=xl796428>库管员:</td>”);  
  202.    strExcel.Append(“<td class=xl806428></td>”);  
  203.    strExcel.Append(“</tr>”);  
  204.          strExcel.Append(“</table></center><!–endprint–>”);  
  205.          strExcel.Append(“</body></html>”);  
  206.   
  207.         return strExcel.ToString();  
  208.     }  
  209.   
  210.   
  211. }  

 

4、打字与印刷出来的效果。

C# 4

 

总结:

当大家相遇三个题材的时候理应从分裂的角度去对待她,那样您就会有例外的缓解格局选用一种最快,最简单,本人最善于的章程去做这么就能压实工作功效。

相关文章