`

手动构建xml xls 日期 datetime number type

    博客分类:
  • java
 
阅读更多
http://ewbi.blogs.com/develops/2005/01/create_excels_s.html

<?xml version="1.0" ?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
  <Styles>
    <Style ss:ID="Default" ss:Name="Normal">
      <Font ss:FontName="Verdana" ss:Size="8" />
    </Style>
    <Style ss:ID="bold">
      <Font ss:FontName="Verdana" ss:Bold="1" />
    </Style>
    <Style ss:ID="date">
      <NumberFormat ss:Format="General Date" />
    </Style>
    <Style ss:ID="mycurrency">
      <Font ss:FontName="Tahoma" ss:Size="10" ss:Bold="1" />
      <NumberFormat ss:Format="&quot;$&quot;#,##0.00" />
    </Style>
    <Style ss:ID="mydate">
      <NumberFormat ss:Format="m/d/yyyy" />
    </Style>
  </Styles>
  <Worksheet ss:Name="Sheet1">
    <Table>
      <Row ss:Index="1">
        <Cell ss:Index="1">
          <Data ss:Type="Number">1</Data>
        </Cell>
        <Cell ss:Index="2" ss:Formula="=R1C1+10">
          <Data ss:Type="Number">11</Data>
        </Cell>
        <Cell ss:Index="3" ss:Formula="=R1C1+20">
          <Data ss:Type="Number"></Data>
        </Cell>
        <Cell ss:Index="4" ss:Formula="=SUM(R1C1:R1C3)" ss:StyleID="mycurrency">
          <Data ss:Type="Number"></Data>
        </Cell>
      </Row>
      <Row ss:Index="2">
        <Cell ss:Index="1">
          <Data ss:Type="Boolean">1</Data>
        </Cell>
      </Row>
      <Row ss:Index="3">
        <Cell ss:Index="1">
          <Data ss:Type="DateTime">2005-01-01T13:54:15.000</Data>
        </Cell>
        <Cell ss:Index="2" ss:StyleID="mydate">
          <Data ss:Type="DateTime">2005-01-02T13:54:15.000</Data>
        </Cell>
        <Cell ss:Index="3" ss:StyleID="date">
          <Data ss:Type="DateTime">2005-01-03T13:54:15.000</Data>
        </Cell>
      </Row>
      <Row ss:Index="4">
        <Cell ss:Index="1">
          <Data ss:Type="String">abc</Data>
        </Cell>
      </Row>
      <Row ss:Index="10">
        <Cell ss:Index="5">
          <Data ss:Type="Error">#N/A</Data>
        </Cell>
      </Row>
    </Table>
  </Worksheet>
  <Worksheet ss:Name="Sheet2">
    <Table>
      <Row ss:Index="1">
        <Cell ss:Index="1" ss:Formula="=Sheet1!R1C1 &amp; &quot; plus text&quot;" ss:StyleID="bold">
          <Data ss:Type="String"></Data>
        </Cell>
      </Row>
    </Table>
  </Worksheet>
</Workbook>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics