Search This Blog

Tuesday, December 11, 2012

Simple sflight XSLT transformation for EXCEL

 <?mso-application progid="Excel.Sheet"?>  
 <?sap.transform simple?>  
 <tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www.sap.com/abapxml/types/dictionary" xmlns:def="http://www.sap.com/abapxml/types/defined" version="1.0">  
  <tt:root name="ROOT" type="?"/>  
  <tt:root name="GT_OUT" type="ddic:TY_FLIGHTS"/>  
  <tt:template>  
   <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>authorname</Author>  
     <LastAuthor>authorname</LastAuthor>  
     <Created>2012-02-01T10:12:47Z</Created>  
     <Company/>  
     <Version>12.00</Version>  
    </DocumentProperties>-->  
    <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">  
     <!-- <ReadOnlyRecommended/>-->  
    </OfficeDocumentSettings>  
    <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">  
     <WindowHeight>11055</WindowHeight>  
     <WindowWidth>19155</WindowWidth>  
     <WindowTopX>0</WindowTopX>  
     <WindowTopY>120</WindowTopY>  
     <ProtectStructure>False</ProtectStructure>  
     <ProtectWindows>False</ProtectWindows>  
    </ExcelWorkbook>  
    <Styles>  
     <Style ss:ID="Default" ss:Name="Normal">  
      <Alignment ss:Vertical="Bottom"/>  
      <Borders/>  
      <Font ss:Color="#000000" ss:FontName="Arial" ss:Size="12" x:Family="Swiss"/>  
      <Interior/>  
      <NumberFormat/>  
      <Protection/>  
     </Style>  
     <Style ss:ID="hdr">  
      <Alignment ss:Horizontal="Center"/>  
      <Borders>  
       <Border ss:Position="Left" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
       <Border ss:Position="Right" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
       <Border ss:Position="Top" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
       <Border ss:Position="Bottom" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
      </Borders>  
      <Font ss:Bold="1" ss:Size="20"/>  
      <Interior ss:Color="#A9D0F5" ss:Pattern="Solid"/>  
     </Style>  
     <Style ss:ID="key">  
      <Borders>  
       <Border ss:Position="Left" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
       <Border ss:Position="Right" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
       <Border ss:Position="Top" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
       <Border ss:Position="Bottom" ss:Color="#000000" ss:LineStyle="Continuous" ss:Weight="1"/>  
      </Borders>  
      <Font ss:Bold="1" ss:Size="20"/>  
      <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>  
     </Style>  
     <Style ss:ID="12r">  
      <Font ss:Bold="1" ss:Color="red"/>  
     </Style>  
     <Style ss:ID="s62">  
      <Protection/>  
     </Style>  
    </Styles>  
    <Worksheet ss:Name="SFLIGHT" ss:Protected="0">  
     <Table x:FullColumns="1" x:FullRows="1">  
 <!--AutofitWidth only works on datetime/numeric fields     -->  
 <!--     <Column ss:AutoFitWidth="1"/>-->  
 <!--     <Column ss:AutoFitWidth="1"/>-->  
      <Column ss:Width="125"/>  
      <Row ss:AutoFitHeight="1" ss:StyleID="hdr">  
       <Cell>  
        <Data ss:Type="String">Airline Code</Data>  
       </Cell>  
       <Cell>  
        <Data ss:Type="String">Connection</Data>  
       </Cell>  
       <Cell>  
        <Data ss:Type="String">Date</Data>  
       </Cell>  
       <Cell>  
        <Data ss:Type="String">Curr</Data>  
       </Cell>  
       <Cell>  
        <Data ss:Type="String">Airfare</Data>  
       </Cell>  
      </Row>  
      <tt:loop ref=".GT_OUT">  
       <Row ss:AutoFitHeight="1">  
        <Cell ss:StyleID="key">  
         <Data ss:Type="String">  
          <tt:value ref="$ref.CARRID"/>  
         </Data>  
        </Cell>  
        <Cell ss:StyleID="12r">  
         <Data ss:Type="String">  
          <tt:value ref="$ref.CONNID"/>  
         </Data>  
        </Cell>  
        <Cell>  
         <Data ss:Type="String">  
           <tt:value ref="$ref.FLDATE"/>  
         </Data>  
        </Cell>  
        <Cell>  
         <Data ss:Type="String">  
          <tt:value ref="$ref.CURRENCY"/>  
         </Data>  
        </Cell>  
        <Cell>  
         <Data ss:Type="Number">  
          <tt:value ref="$ref.PRICE"/>  
         </Data>  
        </Cell>  
       </Row>  
      </tt:loop>  
     </Table>  
 <!--    <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">  
      <PageSetup>  
       <Header x:Margin="0.3"/>  
       <Footer x:Margin="0.3"/>  
       <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>  
      </PageSetup>  
      <Unsynced/>  
      <Print>  
       <ValidPrinterInfo/>  
       <HorizontalResolution>600</HorizontalResolution>  
       <VerticalResolution>600</VerticalResolution>  
      </Print>  
      <Selected/>  
      <Panes>  
       <Pane>  
        <Number>3</Number>  
        <ActiveRow>22</ActiveRow>  
        <ActiveCol>2</ActiveCol>  
       </Pane>  
      </Panes>  
      <ProtectObjects>True</ProtectObjects>  
      <ProtectScenarios>True</ProtectScenarios>  
     </WorksheetOptions>-->  
    </Worksheet>  
   </Workbook>  
  </tt:template>  
 </tt:transform>  

No comments: