Html 转 excel

//引用這三個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>");

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。