쓸만한 주저리

엑셀 파일로 내보내야 할 때

봄돌73 2006. 8. 10. 14:00
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment;filename=income_"&sTime&"_"&eTime&"_"&iPer&".xls"

헤더에 이 두 가지를 추가하면 된다.
실제로는 html 파일로 저장되지만, 엑셀에서 엑셀 문서처럼 읽혀진다.
다만, 엑셀 뷰어로는 못 읽어온다.