Excel导出空白表问题

Excel导出空白表问题,excel,export-to-excel,Excel,Export To Excel,我有一些代码多年来一直在将html表导出到Excel。事情是这样的- private void ExcelExport ( string core_number ) { // set response up for excel export Response.Clear (); Response.Buffer = true; Response.ContentType = "application/vnd.ms-excel"; R

我有一些代码多年来一直在将html表导出到Excel。事情是这样的-

private void ExcelExport ( string core_number )
    {
      // set response up for excel export
      Response.Clear ();
      Response.Buffer = true;
      Response.ContentType = "application/vnd.ms-excel";
      Response.AddHeader ( "content-disposition", "attachment;filename=TEST.xls" );

 .. loops through generates an simple html table ...


   Response.Write ( "</table>" );
   Response.Flush ();
   Response.End();
}
private void excel导出(字符串核心\u编号)
{
//为excel导出设置响应
Response.Clear();
Response.Buffer=true;
Response.ContentType=“application/vnd.ms excel”;
Response.AddHeader(“内容处置”、“附件;文件名=TEST.xls”);
…循环生成一个简单的html表。。。
回答。写(“”);
Response.Flush();
Response.End();
}
我注意到Firefox现在将文件显示为XML文档,而不是Excel文档,当我打开生成的文档时,它将解析失败。此外,一些用户报告在一些旧版本的IE中存在导出问题,即使我在IE中没有任何问题(显示为Excel文档并正确打开)


有人见过这个吗?谢谢您的时间。

没有找到答案,但目前正在解决它。

如果用户遇到问题,可能值得检查Excel的安装选项。有可能他们没有安装一些互操作或共享组件,这可能是MSIE中内容类型处理不正确的原因。我希望你已经发布了解决方案。当用户单击Internet Explorer中的“打开”按钮时,我在Excel导出(在web上使用标准的“将HTML表格转换为Excel”)方面遇到了一个问题。这样做会启动Excel并显示一个空白屏幕(没有打开文档)。单击“保存”或“另存为”将文件保存到磁盘,然后用户可以打开。但我必须让那个愚蠢的“打开”按钮工作,我真的不知所措。。。