#region 导出Excel
string path = ConfigurationManager.AppSettings["TempFilePath"];
if (!System.IO.Directory.Exists(path))
{
System.IO.Directory.CreateDirectory(path);
}
string newFilePath = "" ;
#region xlsx
//newFilePath = path + "" + _PRODWELLTESTDAILY_MAIN_Entity.WELLNAME + " (IL FIELD PRODUCTON WELL TEST REPORT" + txtThedate.Text + ").xlsx";
//FpSpread1.SaveExcel(newFilePath, FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat);
#endregion
#region xls
//方法一
newFilePath = path + "" + _PRODWELLTESTDAILY_MAIN_Entity.WELLNAME + " (IL FIELD PRODUCTON WELL TEST REPORT" + txtThedate.Text + ").xls";
FpSpread1.SaveExcel(newFilePath, FarPoint.Excel.ExcelSaveFlags.NoFlagsSet);
//方法二
FpSpread1.SaveExcel(newFilePath, FarPoint.Web.Spread.Model.IncludeHeaders.BothCustomOnly);
System.IO.MemoryStream s = new System.IO.MemoryStream();
FpSpread1.SaveExcel(s);
s.Close();
#endregion
#endregion
|
|