I am using the following code. Am i missing something ? <h:commandLink action="#{manageCountriesBB.exportHtmlTableToExcel}"> <h:outputText value="Export table to Excel" /> </h:commandLink>
public void exportHtmlTableToExcel() { String filename = "test.xls"; // Setup the output String contentType = "application/vnd.ms-excel"; FacesContext fc = FacesContext.getCurrentInstance(); HttpServletResponse response = (HttpServletResponse) fc .getExternalContext().getResponse(); response.setHeader("Content-disposition", "attachment; filename=" + filename); response.setContentType(contentType); // Write the table back out try { PrintWriter out = response.getWriter(); out.print(htmlBuffer); out.close(); } catch (IOException ex) { spage.processException(ex); } fc.responseComplete(); } =================================================================== Cagatay Civici wrote: > > Are you using the export actionlistener? > > On Tue, Nov 4, 2008 at 9:33 AM, mrfarhankhan <[EMAIL PROTECTED]> > wrote: > >> >> Hi ! >> >> I am following the following link to export my datatable to excel >> http://wiki.apache.org/myfaces/Exporting_DataTable_To_MS-Excel >> >> The problem is that I am using pagination with the table but the excel >> file >> only contains the rows that are currently being displayed in the >> datatable. >> I want all the rows to be exported. >> >> Looking for a solution >> Thanks in advance >> Farhan ! >> -- >> View this message in context: >> http://www.nabble.com/Export-datatable-to-excel-problem-with-pagination-tp20318897p20318897.html >> Sent from the MyFaces - Users mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/Export-datatable-to-excel-problem-with-pagination-tp20318897p20322901.html Sent from the MyFaces - Users mailing list archive at Nabble.com.