Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well I too have some problems in using the exporttoExcel functioanality of primefaces.I have searched a lot on stackoverflow and primefacesForums but just got to know that it's a primefaces related version issue.By the way i have made my own function which is now perfectly working and can also be modified as per exporting to other formats.</p> <pre><code>&lt;p:commandLink id="back" value="Export to Excel" action="#{agendaBean.exportToExl}" immediate="true" ajax="false" style="color: #086A87;" &gt;&lt;/p:commandLink&gt; </code></pre> <p>After clicking on the link the exportToExl method is called in the bean which has the following contents.</p> <pre><code>public String exportToExl() { ExportToExcel expExlBean = new ExportToExcel(); List&lt;String&gt; columnNames = new ArrayList&lt;String&gt;(); columnNames.add("Agenda ID"); columnNames.add("Matter"); columnNames.add("Item"); columnNames.add("OrderNo"); columnNames.add("AccessPrivilegeString"); columnNames.add("DocumentNameDisplay"); columnNames.add("DocumentFolderPath"); List&lt;String&gt; columnType = new ArrayList&lt;String&gt;(); columnType.add(FrameWorkConstants.DO_NOT_FORMAT); columnType.add(FrameWorkConstants.DO_NOT_FORMAT); columnType.add(FrameWorkConstants.DO_NOT_FORMAT); columnType.add(FrameWorkConstants.DO_NOT_FORMAT); columnType.add(FrameWorkConstants.DO_NOT_FORMAT); columnType.add(FrameWorkConstants.DO_NOT_FORMAT); columnType.add(FrameWorkConstants.DO_NOT_FORMAT); String companyFolderPath = new AgendaIMPL() .getCompanyFolderPath(meetingID); if (agendaList != null) { for (int i = 0; i &lt; agendaList.size(); i++) { agendaList.get(i).setDocumentFolderPath(companyFolderPath); } } List expList = agendaList; if (expList == null || expList.isEmpty()) { ResourceBundle rb = ResourceBundle .getBundle("resources.error1"); if (rb != null) { Utils.addMessage(rb.getString("34").trim(), FacesMessage.SEVERITY_ERROR); return null; } } String strVOName = "com.ultimatix.boardAdmin.vo.AgendaVO"; FacesContext fc = FacesContext.getCurrentInstance(); HttpServletResponse response = (HttpServletResponse) fc .getExternalContext().getResponse(); String flagStart = FrameWorkConstants.SINGLE; expExlBean.exportToExcel(columnNames, columnType, response, expList, strVOName, flagStart); fc.responseComplete(); return null; } </code></pre> <p>Here AgendaList is the list you are using in the datatable to populate rows.which you want to print in the excel Sheet.</p> <p>Let me know incase you feel any more concerned issues.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload