【问题标题】:Export jsf page to PDF将 jsf 页面导出为 PDF
【发布时间】:2015-08-05 17:25:36
【问题描述】:

我有一个包含折线图和饼图的页面,我想用这些图表生成 PDF 报告。我怎样才能做到这一点?我试过<p:dataExporter>,但它只适用于桌子。这是我的代码

<p:layoutUnit position="west" size="70%"   >

                                    <p:chart type="line" model="#{reportMscBean.model}"  id="chart" style="width:700px;height:280px"/>  

  <p:separator></p:separator>
                                     <p:chart type="line" model="#{reportMscBean.model2}"  style="width:700px;height:280px" id="graphe2"/>

                        </p:layoutUnit>
                        <p:layoutUnit position="center"  size="30%" style="border:0px;">
                                    <p:chart type="pie" model="#{reportMscBean.pieModel2}"  style="width:250px;height:280px" id="pie2" >
                                    </p:chart>
                                    <p:separator></p:separator>

                                 <p:chart type="pie" model="#{reportMscBean.pieModel1}" style="width:250px;height:280px" id="pie1" >
                                    </p:chart>
                        </p:layoutUnit>             

【问题讨论】:

  • 请避免创建重复的帐户来问同样的问题

标签: jsf pdf charts export reporting


【解决方案1】:

恐怕这是不可能的。出口是基本的。对于复杂的导出,请尝试使用真正的报告工具

【讨论】:

    【解决方案2】:

    您正在使用的&lt;p:dataExporter&gt; 组件只接受表格中结构化的数据,因此不能在整个页面上工作。您可以改为使用一些外部库来实现这一点。以 iText 为例,这是一个常见的选择:iText example

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-15
      • 2013-04-09
      • 2014-09-10
      • 1970-01-01
      相关资源
      最近更新 更多