无法在IE8中生成Excel报告
问题描述:
大家好,我真的很惊讶.
我正在尝试生成一个Excel报告.我的代码在firefox中甚至在IE中都可以完美运行,但在IE8中不起作用.
这是我的代码
Hello guys i am really struck in thing.
I am trying to generate an excel report. My code works perfect in firefox and even in IE as well but its not working in IE8.
This is my code for
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=" + objFileInfo.Name);
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
Response.WriteFile(objFileInfo.FullName);
isCustomErrors = true;
Response.Flush();
Response.End();
我也尝试了所有这些内容类型
I have tried all these content types as well
application/x-msexcel
application/excel
application/x-excel
application/vnd.ms-excel
application/msexcel
application/ms-excel
每当我遇到相同的错误
Everytime i gets same error
"Cannot open PivotTable source file 'File Path.xls'Datasource".
代替文件路径,它显示临时文件夹中某处的路径.
In place of file path its shows a path somewhere in temporary folder.
答
请查看此Microsoft KB ^ ].
Have a look at this Microsoft KB http://support.microsoft.com/default.aspx?scid=kb;en-us;Q211912[^].