7 Replies Latest reply on Oct 27, 2009 3:02 AM by Choi Lee Lai

    excel e:header and e:footer

    Tom ONeill Newbie
      Hello, I'm having trouble getting a header and a footer to appear on my excel spreadsheet. I'll include my two examples below. First is a cut and paste from the seam 2.1.1 users guide. I get an empty document with that. Second is my work, and the resulting document has the rows from the underying list, but again, not the header.

      Thank you for any help. Our customers love the excel generation, and it is very easy for us to create them with the e: tags.

      BTW, I am using seam 2.1.1, jbos 4.2.2, and I'm using open office to view the files.

      Simple test:

      <html xmlns="http://www.w3.org/1999/xhtml"
           xmlns:ui="http://java.sun.com/jsf/facelets"
           xmlns:e="http://jboss.com/products/seam/excel"
           xmlns:f="http://java.sun.com/jsf/core">

           <e:workbook type="jxl">
                <e:worksheet>
                     <e:header>
                          <f:facet name="left">
                               This document was made on #date# and has #total_pages# pages
                          </f:facet>
                          <f:facet name="right">
                               #time#
                          </f:facet>
                     </e:header>
                </e:worksheet>
           </e:workbook>
      </html>
           

      More complex test:


      <html xmlns="http://www.w3.org/1999/xhtml"
           xmlns:ui="http://java.sun.com/jsf/facelets"
           xmlns:e="http://jboss.com/products/seam/excel"
           xmlns:f="http://java.sun.com/jsf/core">

      <e:workbook type="jxl">

           <e:worksheet value="#{farrierPendingBB.selectedFarrierAssignBEs}" var="farrierAssignBE">
              <e:header>
                  <f:facet name="left">
                      This document was made on #date# and has #total_pages# pages
                  </f:facet>
                  <f:facet name="right">
                      #time#
                  </f:facet>
              </e:header>
              <e:column style="xls-column-width: 6000">
                     <f:facet name="header">
                          <e:cell value="Name" templates="general,header"/>
                     </f:facet>
                     <e:cell value="#{farrierAssignBE.name}"/>
                </e:column>
                <e:column style="xls-column-width: 2560">
                     <f:facet name="header">
                          <e:cell value="ID" templates="general,header"/>
                     </f:facet>
                     <e:cell value="#{farrierAssignBE.internalId}"/>
                </e:column>
             
              <e:column style="xls-column-width: 2560">
                     <f:facet name="header">
                          <e:cell value="Due Date" templates="general,header"/>
                     </f:facet>
                     <e:cell value="#{farrierAssignBE.formattedDate}" style="xls-wrap: true"/>
                </e:column>
              <e:column style="xls-column-width: 6000">
                     <f:facet name="header">
                          <e:cell value="Work Needed" templates="general,header"/>
                     </f:facet>
                     <e:cell value="#{farrierAssignBE.proc}" style="xls-wrap: true"/>
                </e:column>
              <e:column style="xls-column-width: 4096">
                     <f:facet name="header">
                          <e:cell value="Owner" templates="general,header"/>
                     </f:facet>
                     <e:cell value="#{farrierAssignBE.owner}" style="xls-wrap: true"/>
                </e:column>
              <e:column style="xls-column-width: 4096">
                     <f:facet name="header">
                          <e:cell value="Location" templates="general,header"/>
                     </f:facet>
                     <e:cell value="#{farrierAssignBE.location}" style="xls-wrap: true"/>
                </e:column>

              <e:column style="xls-column-width: 2560">
                     <f:facet name="header">
                          <e:cell value="Last Done" templates="general,header"/>
                     </f:facet>
                     <e:cell value="#{farrierAssignBE.formattedLastWorkDate}" style="xls-wrap: true"/>
                </e:column>
              <e:column style="xls-column-width: 7000">
                     <f:facet name="header">
                          <e:cell value="Note" templates="general,header"/>
                     </f:facet>
                     <e:cell value="#{farrierAssignBE.note}" style="xls-wrap: true"/>
                </e:column>

           </e:worksheet>
      </e:workbook>
      </html>