0 Replies Latest reply on Jan 25, 2011 5:12 AM by merih sakarya

    excel export from datatable (addin text in the first row of the excel)

    merih sakarya Newbie

      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>