1 Reply Latest reply on Jan 25, 2011 4:46 AM by ilya40umov

    rich:datatable excel export (adding a text in the first row of the excel)

    carsi

      Hi all,

       

      I would like to ask something about rich:datatable excel export. I can successfully export the data table as an excel file. But I would like to add a Text in first row of the excel as well. Is it possible to do that?

      In this example below I tried to add "Description of the Data Table" centences in the first row of the excel but It didnt worked. I just got the values from rich columns.

       

       

      <h:form id="excelExport">    
          <rich:dataTable rowKeyVar="rowKey" value="#{policeList.resultList}" var="police" id="policeList" width="450px" height="400px" > 
              <f:facet name="header"> 
                  <h:outputText value="Description of the Data Table" /> 
              </f:facet> 
      
              <rich:column width="100px" sortable="true" filterBy="#{police.policeNo}" filterEvent="onkeyup"> 
                  <f:facet name="header"> 
                      <h:outputText value="Policy No" /> 
                  </f:facet> 
                  <h:outputText value="#{police.policeNo}" id="policeNo" /> 
              </rich:column> 
      
              <rich:column width="200px" sortable="true" filterBy="#{police.policeAdi}" filterEvent="onkeyup"> 
                  <f:facet name="header"> 
                      <h:outputText value="Policy Name" /> 
                  </f:facet> 
                  <h:outputText value="#{police.policeAdi}" id="name" /> 
              </rich:column> 
      
          </rich:dataTable>
          <h:commandButton id="exporter" type="Submit" value="Export to Excel" action="#{org.jboss.seam.excel.exporter.excelExporter.export('excelExport:policeList')}" />
      </h:form>
      
        • 1. rich:datatable excel export (adding a text in the first row of the excel)
          ilya40umov

          Hm. I think you should better post this on the Seam forum because you are using org.jboss.seam.excel.exporter.excelExporter.export to make an excel file. As alternative I can suggest you to write the export part by yourself(But yes, it's not so elegant) and then you will be able to write to the file whatever you want. Or you can wait for the answer if suddenly there's someone here who knows features of Seam well.