摘要:
///<summary>///将DataTable数据导出到EXCEL,调用该方法后自动返回可下载的文件流///</summary>///<paramname="dtData">要导出的数据源</param>publicstaticvoidDataTable1Excel(System.Data.DataTabledtData){System.Web.UI.WebControls.GridViewgvExport=null;//当前对话System.Web.HttpContextcurContext=System.Web.Htt 阅读全文
摘要:
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 阅读全文
摘要:
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. 阅读全文