Richfaces DataTable PDF导出 [英] Richfaces DataTable PDF export

查看:175
本文介绍了Richfaces DataTable PDF导出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的一个小项目使用 Seam 2.2.1 。我知道有一个excel导出为 richfaces:dataTable ,但是有什么像这样的PDF?我真的不想用 iText 编写PDF导出。

I'm using Seam 2.2.1 for a little project of mine. I know there is a excel export for richfaces:dataTable but is there something like this for PDFs too? I don't really want to write a PDF export with iText.

注意

推荐答案

您可以使用 Seam PDF

它在内部使用iText,但是你不不得不编写任何iText代码。

It does use iText internally, but you don't have to write any iText code.

创建一个链接,使用相同的列表来迭代RichFaces datatable。

Create a link that takes the same List you are using iterate the RichFaces datatable.

<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 this. Remember to wrap everything inside a

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

这篇关于Richfaces DataTable PDF导出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆