ASP.NET의 Excel 시트로 데이터 전송 그리드보기. 난 당신의 코드에 어떤 문제가 있는지 확실하지 않다ASP.NET에서 gridview에서 Excel 로의 데이터 내보내기
Response.ClearContent();
Response.Buffer = true;
Response.AddHeader("content-disposition", string.Format("attachment; filename={0}",
"Customers.xls"));
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
gvdetails.AllowPaging = false; gvdetails.DataBind();
gvdetails.HeaderRow.Style.Add("background-color", "#FFFFFF");
gvdetails.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
지금의로 발생하는 정확한 문제는 무엇인가? – pordi
이 코드를 수행하는 중 빈을 표시하십시오. excel 시트 데이터를 Excel 시트에로드하지 않았습니다. Excel 시트에서 거드 뷰 데이터를로드하는 방법을 참조하십시오. –