7 Replies Latest reply on Oct 27, 2009 3:02 AM by choilee

    excel e:header and e:footer

    oneilltg
      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>



        • 1. Re: excel e:header and e:footer
          olsego

          I have exactly the same issue

          • 2. Re: excel e:header and e:footer
            nickarls

            Well, first we must agree what a header and a footer is ;-)


            If you check at your empty example xls from the guide and go to Insert -> Text -> Header & Footer (Excel 2007) you will see that it's there.

            • 3. Re: excel e:header and e:footer
              oneilltg

              Ha! You are correct. The headers and footers work as designed. Just not what I thought they were.


              Thanks for the info. I really appreciate you taking the time to develop the excel xhtml functionality.


              -Tom

              • 4. Re: excel e:header and e:footer

                hi...i hav problem to display the header. i would like to display multiples line in the header. example likes company name and address.


                ABC Company
                Adress: xxxxx
                Phone:123456 Fax:123456


                i only able to display one line, anyone can help on this?

                • 5. Re: excel e:header and e:footer

                  c lee wrote on Oct 26, 2009 14:03:


                  hi...i hav problem to display the header. i would like to display multiples line in the header. example likes company name and address.

                  ABC Company
                  Adress: xxxxx
                  Phone:123456 Fax:123456

                  i only able to display one line, anyone can help on this?


                  sorry...the header should b in this way.


                  Line 1 is ABC Company


                  Line 2 is Adress: xxxxx


                  Line 3 is Phone:123456 Fax:123456

                  • 6. Re: excel e:header and e:footer
                    nickarls

                    Tried setting wrap to true and using backslash-n?

                    • 7. Re: excel e:header and e:footer

                      thanks nicklas, it is work for me in this way, even without using the blacklash-n.


                      <e:header>
                           <f:facet name="center">
                                  <e:cell style="xls-wrap:true;">
                                This is line 1
                                This is line 2....
                                This is line 3....
                               </e:cell>
                              </f:facet>
                      </e:header>