摘要: ///<summary>///将DataTable数据导出到EXCEL,调用该方法后自动返回可下载的文件流///</summary>///<paramname="dtData">要导出的数据源</param>publicstaticvoidDataTable1Excel(System.Data.DataTabledtData){System.Web.UI.WebControls.GridViewgvExport=null;//当前对话System.Web.HttpContextcurContext=System.Web.Htt 阅读全文
posted @ 2012-09-15 12:19 hishanghai 阅读(688) 评论(0) 推荐(0) 编辑
摘要: protectedvoidDatatableExcelC(System.Data.DataTabledt){Microsoft.Office.Interop.Excel.Applicationexcelkccx=newMicrosoft.Office.Interop.Excel.ApplicationClass();Microsoft.Office.Interop.Excel._Workbookwb;Microsoft.Office.Interop.Excel._Worksheetws=null;wb=excelkccx.Workbooks.Add(true);stringtbname=&qu 阅读全文
posted @ 2012-09-15 11:11 hishanghai 阅读(235) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespaceSaveFileTest{publicpartialclassForm1:Form{publicForm1(){InitializeComponent();}privatevoidBtnSaveFile_Click(objectsender,E. 阅读全文
posted @ 2012-09-15 09:59 hishanghai 阅读(536) 评论(0) 推荐(0) 编辑