国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > .NET > 正文

ASP.NET使用xslt將xml轉(zhuǎn)換成Excel

2024-07-10 12:47:10
字體:
供稿:網(wǎng)友

序:

  最近在給客戶做一個(gè)管理系統(tǒng)的時(shí)候,客戶提出要將查詢結(jié)果導(dǎo)出到Excel。對(duì)于還是實(shí)習(xí)生的我倍感壓力,于是找了點(diǎn)資料。網(wǎng)上有個(gè)示例,其中方法十分簡(jiǎn)單。于是照貓畫虎,把方法和心得與大家分享。OK,Let`s go

第一步:

  創(chuàng)建一個(gè)Excel文件(就是 普通的Excel),在第一個(gè)單元格輸入“city”,然后選擇“另存為”,此時(shí)彈出保存窗口。注意:將保持格式選擇為“XML 表格(*.xml)”,點(diǎn)擊保存。完畢后用記事本打開這個(gè)Excel文件。你將看到如下的代碼

<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"xmlns:o="urn:schemas-microsoft-com:office:office"xmlns:x="urn:schemas-microsoft-com:office:excel"xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"xmlns:html="http://www.w3.org/TR/REC-html40"><DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"><Author>MC SYSTEM</Author><LastAuthor>MC SYSTEM</LastAuthor><Created>2009-05-28T16:20:57Z</Created><Company>MC SYSTEM</Company><Version>11.5606</Version></DocumentProperties><ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"><WindowHeight>11250</WindowHeight><WindowWidth>18180</WindowWidth><WindowTopX>120</WindowTopX><WindowTopY>75</WindowTopY><ProtectStructure>False</ProtectStructure><ProtectWindows>False</ProtectWindows></ExcelWorkbook><Styles><Style ss:ID="Default" ss:Name="Normal"><Alignment ss:Vertical="Center"/><Borders/><Font ss:FontName="宋體" x:CharSet="134" ss:Size="12"/><Interior/><NumberFormat/><Protection/></Style></Styles><Worksheet ss:Name="Sheet1"><Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" x:FullColumns="1"x:FullRows="1" ss:DefaultColumnWidth="54" ss:DefaultRowHeight="14.25"><Row ss:><Cell><Data ss:Type="String">org</Data></Cell></Row></Table><WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"><Unsynced/><Selected/><Panes><Pane><Number>3</Number><ActiveRow>3</ActiveRow><ActiveCol>1</ActiveCol></Pane></Panes><ProtectObjects>False</ProtectObjects><ProtectScenarios>False</ProtectScenarios></WorksheetOptions></Worksheet><Worksheet ss:Name="Sheet2"><Table ss:ExpandedColumnCount="0" ss:ExpandedRowCount="0" x:FullColumns="1"x:FullRows="1" ss:DefaultColumnWidth="54" ss:DefaultRowHeight="14.25"/><WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"><Unsynced/><ProtectObjects>False</ProtectObjects><ProtectScenarios>False</ProtectScenarios></WorksheetOptions></Worksheet><Worksheet ss:Name="Sheet3"><Table ss:ExpandedColumnCount="0" ss:ExpandedRowCount="0" x:FullColumns="1"x:FullRows="1" ss:DefaultColumnWidth="54" ss:DefaultRowHeight="14.25"/><WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"><Unsynced/><ProtectObjects>False</ProtectObjects><ProtectScenarios>False</ProtectScenarios></WorksheetOptions></Worksheet></Workbook>            
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 达州市| 大渡口区| 邵阳县| 历史| 阳曲县| 新泰市| 仪征市| 重庆市| 固镇县| 凤台县| 永清县| 宾阳县| 广水市| 乌鲁木齐市| 曲水县| 博湖县| 大英县| 康平县| 鹤山市| 辛集市| 卫辉市| 昌宁县| 开远市| 赤城县| 清徐县| 宜兰市| 冀州市| 沈阳市| 综艺| 花莲县| 蒙山县| 汪清县| 青海省| 威远县| 东乌珠穆沁旗| 张家口市| 新兴县| 望谟县| 嘉义县| 保山市| 合山市|