标签:proc xls excel for poi flush server source tpc
/// <summary>
/// 导出
/// </summary>
/// <param name="magnetic_CheckPointTemplatesB_OID"></param>
/// <param name="httpResponse"></param>
private void Export(HttpResponse httpResponse,DataTable dt)
{
try
{
dt.TableName = "auto_price_list";
WorkbookDesigner wd = new WorkbookDesigner();
string templateFileName = HttpContext.Current.Server.MapPath("\\模板.xlsx");
wd.Open(templateFileName);
wd.SetDataSource(dt);
wd.Process();
wd.Save(string.Format("导出名称.xls"), SaveType.OpenInExcel, FileFormatType.Excel2003, httpResponse);
httpResponse.Flush();
httpResponse.Close();
httpResponse.End();
}
catch(Exception ex)
{
}
}
标签:proc xls excel for poi flush server source tpc
原文地址:http://www.cnblogs.com/wangnengduo/p/6594395.html