标签:
//引用這三個xmlns
Response.Write("<html xmlns:o=‘urn:schemas-microsoft-com:office:office‘");
Response.Write("xmlns:x=‘urn:schemas-microsoft-com:office:excel‘");
Response.Write("xmlns=‘http://www.w3.org/TR/REC-html40‘>");
Response.Write("<meta http-equiv=Content-Type content=text/html;charset=utf-8>");
//在head中加入xml定義
Response.Write("\n <head>");
Response.Write("\n <xml>");
Response.Write("\n <x:ExcelWorkbook>");
Response.Write("\n <x:ExcelWorksheets>");
Response.Write("\n <x:ExcelWorksheet>");
Response.Write("\n <x:Name>Test</x:Name>");
//以下針對此工作表進行屬性設定
Response.Write("\n <x:WorksheetOptions>");
Response.Write("\n <x:FrozenNoSplit/>");
//設定凍結行號
Response.Write("\n <x:SplitHorizontal>2</x:SplitHorizontal>");
//設定卷軸起始行號
Response.Write("\n <x:TopRowBottomPane>2</x:TopRowBottomPane>");
Response.Write("\n <x:ActivePane>2</x:ActivePane>");
Response.Write("\n </x:WorksheetOptions>");
Response.Write("\n </xml>");
Response.Write("\n </head>");
Response.Write("\n <body>");
标签:
原文地址:http://www.cnblogs.com/caleyun/p/4288412.html