Axel Richter: Excel-Export in mehrere Sheets

Beitrag lesen

Hallo,

Oder gibts doch noch ne Alternative ;-)

Ja, XML als Excel Content-Type ausliefern. Das setzt aber mindestens Excel 2002 voraus.
Beispiel:

  
<?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>Richter</Author>  
 </DocumentProperties>  
 <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">  
  <ProtectStructure>False</ProtectStructure>  
  <ProtectWindows>False</ProtectWindows>  
 </ExcelWorkbook>  
 <Styles>  
  <Style ss:ID="EUR_negativ_rot">  
   <NumberFormat ss:Format="#,##0.00\ [$EUR];[Red]\-#,##0.00\ [$EUR]"/>  
  </Style>  
 </Styles>  
 <Worksheet ss:Name="Tabelle1">  
  <Table>  
   <Row>  
    <Cell><Data ss:Type="String">Tabelle1 Zelle A1</Data></Cell>  
    <Cell ss:StyleID="EUR_negativ_rot"><Data ss:Type="Number">12345.6</Data></Cell>  
   </Row>  
  </Table>  
 </Worksheet>  
 <Worksheet ss:Name="Tabelle2">  
  <Table>  
   <Row>  
    <Cell><Data ss:Type="String">Tabelle2 Zelle A1</Data></Cell>  
    <Cell ss:StyleID="EUR_negativ_rot"><Data ss:Type="Number">-12345.6</Data></Cell>  
   </Row>  
  </Table>  
 </Worksheet>  
 <Worksheet ss:Name="Tabelle3">  
  <Table>  
   <Row>  
    <Cell><Data ss:Type="String">Tabelle3 Zelle A1</Data></Cell>  
   </Row>  
   <Row>  
    <Cell><Data ss:Type="String">Tabelle3 Zelle A2</Data></Cell>  
   </Row>  
   <Row>  
    <Cell></Cell>  
    <Cell><Data ss:Type="String">Tabelle3 Zelle B3</Data></Cell>  
   </Row>  
  </Table>  
 </Worksheet>  
</Workbook>  

Eine Referenz zum XML findest Du, indem Du xsdref.msi herunterlädst und installierst. Im Installationsordner gibt es einen Ordner Help mit einer OfficeXMLSDK.chm.

viele Grüße

Axel