0
我正在使用c#.net的Excel導出工作。我正在使用下面的代碼,它在桌面和筆記本電腦中工作正常。導出Excel無法在IPAD中工作
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天裏,我在尋找......真的幫助專家。