<?xml version="1.0" encoding="UTF-8"?>
<Layout
  xmlns="urn:speedata.de:2009/publisher/en"
  xmlns:sd="urn:speedata:2009/publisher/functions/en">

  <Options
    show-grid="no"
    mainlanguage="English (Great Britain)"
  />
  <SetGrid nx="16" height="12pt"/>
  <Pageformat width="10cm" height="11cm"/>

  <DefineColor name="white" value="#fff"/>
  <DefineColor name="gray" value="#eee"/>

  <LoadFontfile name="MyriadPro-Regular" filename="MyriadPro-Regular.otf"/>
  <LoadFontfile name="MyriadPro-Bold" filename="MyriadPro-Bold.otf"/>

  <DefineFontfamily name="text" fontsize="10" leading="12">
    <Regular fontface="MyriadPro-Regular"/>
    <Bold fontface="MyriadPro-Bold"/>
  </DefineFontfamily>

  <Record element="data">
    <SetVariable variable="_last_tr_data" select="0"/>
    <PlaceObject>
      <Table stretch="max" padding="4pt">
        <Tablehead page="first">
          <Tr backgroundcolor="gray">
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>No.</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Image</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Name</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Art-No.</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Price</Value></B></Paragraph></Td>
          </Tr>
        </Tablehead>
        <Tablehead page="all">
          <Tr backgroundcolor="gray">
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>No.</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Image</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Name</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Art-No.</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Price</Value></B></Paragraph></Td>
          </Tr>
          <Tr>
            <Td colspan="3"></Td>
            <Td border-bottom="0.25pt" colspan="2" align="right"><Paragraph fontface="text"><Value>Sum: </Value><Value select="$_last_tr_data"/></Paragraph></Td>
          </Tr>
        </Tablehead>
        <Tablefoot page="all">
          <Tr>
            <Td colspan="3"></Td>
            <Td border-top="0.25pt" colspan="2" align="right"><Paragraph fontface="text"><Value>Sum:</Value><HSpace/><Value select="$_last_tr_data"/></Paragraph></Td>
          </Tr>
        </Tablefoot>
        <Tablefoot page="last">
          <Tr>
            <Td colspan="3"></Td>
            <Td border-top="0.25pt" colspan="2" align="right"><Paragraph fontface="text"><Value>Total:</Value><HSpace/><Value select="$_last_tr_data"/></Paragraph></Td>
          </Tr>
        </Tablefoot>
        <ForAll select="item">
          <Tr data="@sum" backgroundcolor="{sd:alternating('tab','white','gray')}">
            <Td align="center"><Paragraph><Value select="position()"></Value></Paragraph></Td>
            <Td align="center"><Image maxwidth="2" maxheight="3" file="{@image}"/></Td>
            <Td align="left"><Paragraph><Value select="@name"></Value></Paragraph></Td>
            <Td align="left"><Paragraph><Value select="@artnr"></Value></Paragraph></Td>
            <Td align="right"><Paragraph><Value select="@price"></Value></Paragraph></Td>
          </Tr>
        </ForAll>
      </Table>
    </PlaceObject>
  </Record>

</Layout>
