When I use the p:dataExporter for a rich:dataTable (RichFaces) or p:dataTable, the last row is not coming up in the exported PDF file (No Exception occuring on the server side).
Export to csv, xml works fine for the same scenarios. Its only the PDF export missing the last record. Any suggestion?
DataExport missing last record only in PDF format
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Strange, I couldn't replicate this with online showcase demo, last record is there in pdf export. Can you test with the online demo?
Online demo is working fine. It showed the records from 0 to 99. So I paid attention to the output content than just counting the rows
I had the last (5th) column as h:commandLink to view the score as below.
The 5 columns displayed in the dataTable were
ExamId ExamName ScheduleId PublicURL ViewScore
So the PDF when exporting the data was assigning the ExamId of the 2nd row to the View Score column of the 1st row and so on. Because I tested with 4 rows, the result was 3 rows in the PDF where as in CSV, XML it was exported as 4 rows.
Solution: Excluding the column from the exported report worked for me.
I had the last (5th) column as h:commandLink to view the score as below.
Code: Select all
<p:column>
<f:facet name="header"><h:outputText value="View Score" /></f:facet>
<h:commandLink action="#{reportcenter.viewScore}">
<h:graphicImage value="/img/ok.png" style="border:none;"/>
</h:commandLink>
</p:column>
ExamId ExamName ScheduleId PublicURL ViewScore
So the PDF when exporting the data was assigning the ExamId of the 2nd row to the View Score column of the 1st row and so on. Because I tested with 4 rows, the result was 3 rows in the PDF where as in CSV, XML it was exported as 4 rows.
Solution: Excluding the column from the exported report worked for me.