【網上說使用 VBS 】
我的excel檔案是用報表工具下載的(下圖所示),本來想實作決議轉碼為正規excel,用poi讀取,但是只能獲取文本 不能讀取到其中樣式,現在轉換思路,直接用java代碼實作后臺”另存為“為正規excel,求大神指點迷津!!!


uj5u.com熱心網友回復:
用報表工具生成的excel 編譯器打開里面是xml格式 如上圖所示 想變為正規excel格式uj5u.com熱心網友回復:
<?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">
<Created>2009-12-18T14:44:09Z</Created>
<Version>12.00</Version>
</DocumentProperties>
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<WindowHeight>10005</WindowHeight>
<WindowWidth>10005</WindowWidth>
<WindowTopX>120</WindowTopX>
<WindowTopY>135</WindowTopY>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Center"/>
<Font ss:FontName="Verdana" x:Family="Swiss"/>
</Style>
<Style ss:ID="s62">
<Font ss:FontName="Verdana" x:Family="Swiss"/>
</Style>
<Style ss:ID="s63">
<Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
<Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>
</Style>
</Styles>
<Worksheet ss:Name="Average">
<Table ss:ExpandedColumnCount="5" ss:ExpandedRowCount="2" x:FullColumns="1"
x:FullRows="1" ss:StyleID="s62" ss:DefaultColumnWidth="54">
<Column ss:StyleID="s62" ss:AutoFitWidth="0" ss:Width="140.25"/>
<Column ss:StyleID="s62" ss:AutoFitWidth="0" ss:Width="99.75" ss:Span="3"/>
<Row>
<Cell ss:StyleID="s63"><Data ss:Type="String">col1</Data></Cell>
<Cell ss:StyleID="s63"><Data ss:Type="String">col2</Data></Cell>
<Cell ss:StyleID="s63"><Data ss:Type="String">col3</Data></Cell>
<Cell ss:StyleID="s63"><Data ss:Type="String">col4</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="Number">1</Data></Cell>
<Cell><Data ss:Type="Number">2</Data></Cell>
<Cell><Data ss:Type="Number">3</Data></Cell>
<Cell><Data ss:Type="Number">4</Data></Cell>
</Row>
</Table>
</Worksheet>
</Workbook>
uj5u.com熱心網友回復:
xml格式的excel檔案,類似于上面這串代碼uj5u.com熱心網友回復:
還不知道怎么解決。uj5u.com熱心網友回復:
老哥,這個問題現在解決了嗎。我百度了很多方案,但是還是無法解決這個問題。求解惑。
管理員別刪行嗎?
uj5u.com熱心網友回復:
我也在研究這個問題,老哥你解決了嗎
uj5u.com熱心網友回復:
我目前解決了。因為他就是個xml格式打開的。
我目前的方案是用SAXReader讀取,然后VisitorSupport 去拿到我所需要的節點值。
uj5u.com熱心網友回復:
老哥,這個問題現在解決了嗎。我百度了很多方案,但是還是無法解決這個問題。
求解惑。
管理員別刪行嗎?
解決了嗎?
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/270198.html
標籤:Java相關
