我通常使用 Response.Write 将我的报告导出到 Excel 文件。
例如
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment; filename=MyFile.xls");
Response.ContentType = "application/vnd.ms-excel";
Response.Write("<meta http-equiv=Content-Type content=text/html;charset=UTF-8>");
Response.Write("<table>");
Response.Write("<tr>");
Response.Write("<td>");
Response.Write("Hello");
Response.Write("</td>");
Response.Write("</tr>");
Response.Write("</table>");
Response.End();
现在我想导出一个包含多张工作表的 excel 文件。我怎样才能做到这一点?