序:
最近在給客戶做一個(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>
新聞熱點(diǎn)
疑難解答
圖片精選