NOPI导出 Excel在“.xlsx”的部份内容有问题

阅读更多

NOPI导出 Excel在“.xlsx”的部份内容有问题。你要我们尽可能恢复吗?

 

                MemoryStream ms = new MemoryStream();

                workbook.Write(ms);

                HttpResponseMessage response = new HttpResponseMessage();

                response.StatusCode = HttpStatusCode.OK;

               

                response.Content = new ByteArrayContent(ms.GetBuffer());

                response.Content.Headers.ContentLength = long.Parse(ms.ToArray().Length.ToString());

                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");

                response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment");

你可能感兴趣的:(asp.net,NOPI,excel)