我正在使用OpenXMl生成Excel文件(.xlsx)。我可以在我的电脑上打开生成的文件(.xlsx),但我不能在我的Ipad上打开它。它甚至没有密码保护,但我得到了912错误。
这是我的C#代码
string fileName = "Report.xlsx";
Response.Clear();
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";// "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"; //"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" '"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" '"application/vnd.ms-excel"
Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);任何帮助都是非常感谢的。
发布于 2014-08-08 21:16:45
您是否尝试过使用第三方组件(如ClosedXML )生成所需的.xlsx文件?
我们最近使用了它,它需要15分钟来实现:也许你可以试一试。如果问题与不完全符合OpenXml格式有关,也许ClosedXml可以做得更好……
Github (从Codeplex移出)
https://stackoverflow.com/questions/20628143
复制相似问题