2011-11-11 4 views
1

Excel .xls 파일을 생성하는 Classic ASP 파일 작업. 현재 워크 시트 제목을 설정하는 방법이 있는지 궁금합니다. 파일 이름이 Ad_Results.xls 인 경우 현재 워크 시트는 Ad_Results 1이됩니다. Excel 스프레드 시트 워크 시트 제목 설정

내가 처음에 파일을 만들 사용하고있는 코드입니다 :

Response.ContentType = "application/vnd.ms-excel" 
Response.AddHeader "Content-Disposition", "attachment;filename=Shoom_Ad_Results.xls" 
Response.CharSet = "iso-8859-1" 

내가 구글에서 검토 한하지만 최종 버전은 존재하지 않으며, 실제로 그것을 할 수 있다면 진술이다. 감사.

답변

1

클래식 ASP에 대해 잘 모르지만 그냥은 ASP.NET에서이 작업을 수행했습니다. 어쩌면 당신은 유용 할 수 있습니다.

Response.Write("<html xmlns:x=\"urn:schemas-microsoft-com:office:excel\">"); 
Response.Write("<head>"); 
Response.Write("<meta http-equiv=\"Content-Type\" content=\"text/html;charset=windows-1252\">"); 
Response.Write("<!--[if gte mso 9]>"); 
Response.Write("<xml>"); 
Response.Write("<x:ExcelWorkbook>"); 
Response.Write("<x:ExcelWorksheets>"); 
Response.Write("<x:ExcelWorksheet>"); 
Response.Write("<x:Name>Sheet1</x:Name>"); 
Response.Write("</x:ExcelWorksheet>"); 
Response.Write("</x:ExcelWorksheets>"); 
Response.Write("</x:ExcelWorkbook>"); 
Response.Write("</xml>"); 
Response.Write("<![endif]-->"); 
Response.Write("</head>"); 
관련 문제