Export Richfaces DataTable PDF

I use Seam 2.2.1for my small project. I know there is an excel export for richfaces:dataTable, but is there something similar for PDF files? I do not want to write a PDF export from iText.

Hi

+2
source share
2 answers

You can easily export generated HTML to PDF with Seam PDF

It uses iText internally, but you do not need to write any iText code.

Create a link that uses the same list you use, iterate over RichTaces data.

<p:table  columns="2" headerRows="1" widthPercentage="95" widths="0.5 0.5" spacingBefore="10">
    <p:cell backgroundColor="#EEEEEE">#{messages['notes.description']}</p:cell>
    <p:cell backgroundColor="#EEEEEE">#{messages['notes.processUserName']}</p:cell>
    <ui:repeat var="note" value="#{yourListHere}">
        <p:cell>#{note.description}</p:cell>
        <p:cell>#{note.processUserName}</p:cell>
    </ui:repeat>
</p:table>

Something like that. Remember to wrap everything inside

<p:document xmlns:p="http://jboss.com/products/seam/pdf">
+2
source

<rich:dataTable>, <p:dataTable> (primefaces), PDF. .

JasperReports PDF.

+1

Source: https://habr.com/ru/post/1786598/


All Articles