Excuse me sir, Are you saved? (선생님, 구원받으셨습니까?)

If you died tonight, Are you going to heaven? (당신이 만약 오늘 밤 죽는다면, 천국에 갈 수 있습니까?)

For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life. (하나님이 세상을 이처럼 사랑하사 독생자를 주셨으니 이는 그를 믿는 자마다 멸망하지 않고 영생을 얻게 하려 하심이라)

-John 3:16 (요한복음 3장 16절)

분류 전체보기 (178)
Embeded (3)
.NET (13)
DB (6)
Javascript (0)
Visual Studio (0)
Project (7)
Experience (0)
General (13)
Car (0)
Story (12)
YBC (4)
Book (6)
Movie (1)
구 MiniHomepy (109)
Visitors up to today!
Today hit, Yesterday hit
daisy rss
2009. 5. 26. 17:09

//파일 이름 지정
string fileName = "exp"+ "5" + "_A.xls";

//컨텐츠 타입 설정
Response.ContentType = "application/vnd.ms-excel";

//컨텐츠 헤더 설정
Response.AddHeader("Content-Disposition","attachment;fileName="+fileName);

//한글로 캐릭터 셋 설정..
Response.Charset = "euc-kr";

//ViewState 사용 안함
DataGrid1.EnableViewState = false;

//쓰기 객체 생성
System.IO.StringWriter tw = new System.IO.StringWriter();

//html쓰기 객체 생성
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);

//데이터 그리드의 내용을 html로 쓴다.

//내용물은 테이블 ..
이런 식이 된다.

this.ClearControls(DataGrid1);

DataGrid1.RenderControl(hw);

//한글화깨짐을 해결하는 방법..
String convStr = tw.ToString();
Response.Write(convStr);

//응답객체 종료
Response.End();