我正在 c# .net 中的 Excel 导出中工作。我正在使用以下代码,该代码在台式机和笔记本电脑上运行良好。
homeServices = new HomeServices();
string htmlOutput = "";
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.ClearHeaders();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.ContentType = "application/ms-excel";
HttpContext.Current.Response.Write(@"<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">");
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=Export.xls");
HttpContext.Current.Response.Charset = "utf-8";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("windows-1250");
htmlOutput = homeServices.ExportHomeData();
HttpContext.Current.Response.Write(htmlOutput);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
但是当我在 IPAD 中使用它时,我收到了类似的错误
Unable to Read Document. An error occurred while reading the document.
以上代码是否不支持IPAD。
注意:我已经搜索了很多,并且我至少找到了这个问题的相关解决方案。在过去的 3 天里,我正在搜索..请帮助专家。