码迷,mamicode.com
首页 > Web开发 > 详细

Html 转 excel

时间:2015-02-12 18:05:25      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:

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

Html 转 excel

标签:

原文地址:http://www.cnblogs.com/caleyun/p/4288412.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!