如何在Jasper报表中添加目录

mart

我正在使用JasperSoft Studio。我正在生成一个报告,其中也包含本章和子章。但是所有这些章节和子章节都在子报表中进行了配置。

如何在目录中将所有这些章节和子章节名称与链接,页码格式化为一页,就像文档的标准目录一样?

编辑:移动用户对问题的答案(应该是对问题的编辑)

书签进入jasperserver(在单独的选项卡中),但不进入报告。在目录中,所有字段评价时间=报告。这是我的TOC jrxml代码。

<detail>
    <band height="25" splitType="Stretch">
        <property name="local_mesure_unitheight" value="pixel"/>
        <property name="com.jaspersoft.studio.unit.height" value="px"/>
        <printWhenExpression><![CDATA[$F{level} == 1]]></printWhenExpression>
        <textField evaluationTime="Report" hyperlinkType="LocalAnchor">
            <reportElement style="HeadingLabel1" x="0" y="5" width="470" height="20" uuid="379fcff2-021d-4761-a89a-eeb772723b1b">
                <property name="local_mesure_unitheight" value="pixel"/>
                <property name="com.jaspersoft.studio.unit.height" value="px"/>
                <property name="local_mesure_unity" value="pixel"/>
                <property name="com.jaspersoft.studio.unit.y" value="px"/>
            </reportElement>
            <textFieldExpression><![CDATA[$F{label}]]></textFieldExpression>
            <hyperlinkAnchorExpression><![CDATA[$F{label}]]></hyperlinkAnchorExpression>
        </textField>
        <textField evaluationTime="Auto" hyperlinkType="LocalAnchor">
            <reportElement style="HeadingIndex1" x="470" y="5" width="45" height="20" uuid="a31e80f3-f1fa-4643-adbe-77a61c7b9051">
                <property name="local_mesure_unitheight" value="pixel"/>
                <property name="com.jaspersoft.studio.unit.height" value="px"/>
                <property name="com.jaspersoft.studio.unit.y" value="px"/>
            </reportElement>
            <textElement textAlignment="Right" verticalAlignment="Bottom"/>
            <textFieldExpression><![CDATA[$V{PAGE_NUMBER} + $F{pageIndex} + 1]]></textFieldExpression>
            <hyperlinkAnchorExpression><![CDATA[$F{label}]]></hyperlinkAnchorExpression>
        </textField>
    </band>
    <band height="25" splitType="Stretch">
        <property name="local_mesure_unitheight" value="pixel"/>
        <property name="com.jaspersoft.studio.unit.height" value="px"/>
        <printWhenExpression><![CDATA[$F{level} == 2]]></printWhenExpression>
        <textField evaluationTime="Report" hyperlinkType="LocalAnchor">
            <reportElement style="HeadingLabel2" x="40" y="5" width="430" height="20" uuid="379fcff2-021d-4761-a89a-eeb772723b1b">
                <property name="local_mesure_unitheight" value="pixel"/>
                <property name="com.jaspersoft.studio.unit.height" value="px"/>
                <property name="com.jaspersoft.studio.unit.y" value="px"/>
            </reportElement>
            <textFieldExpression><![CDATA[$F{label}]]></textFieldExpression>
            <hyperlinkAnchorExpression><![CDATA[$F{label}]]></hyperlinkAnchorExpression>
        </textField>
        <textField evaluationTime="Auto" hyperlinkType="LocalAnchor">
            <reportElement style="HeadingIndex2" x="470" y="5" width="45" height="20" uuid="a31e80f3-f1fa-4643-adbe-77a61c7b9051">
                <property name="local_mesure_unitheight" value="pixel"/>
                <property name="com.jaspersoft.studio.unit.height" value="px"/>
                <property name="com.jaspersoft.studio.unit.y" value="px"/>
            </reportElement>
            <textElement textAlignment="Right" verticalAlignment="Bottom"/>
            <textFieldExpression><![CDATA[$V{PAGE_NUMBER} + $F{pageIndex} + 1]]></textFieldExpression>
            <hyperlinkAnchorExpression><![CDATA[$F{label}]]></hyperlinkAnchorExpression>
        </textField>
        <textField evaluationTime="Report" hyperlinkType="LocalAnchor">
            <reportElement style="HeadingLabel2" x="20" y="5" width="20" height="20" uuid="ae12cafd-22e8-45ae-a1a7-8e00a8208cf0">
                <property name="local_mesure_unitheight" value="pixel"/>
                <property name="com.jaspersoft.studio.unit.height" value="px"/>
                <property name="local_mesure_unity" value="pixel"/>
                <property name="com.jaspersoft.studio.unit.y" value="px"/>
            </reportElement>
            <textFieldExpression><![CDATA[$V{level2Index} + "."]]></textFieldExpression>
            <hyperlinkAnchorExpression><![CDATA[$F{label}]]></hyperlinkAnchorExpression>
        </textField>
    </band>
    <band height="15" splitType="Stretch">
        <property name="local_mesure_unitheight" value="pixel"/>
        <property name="com.jaspersoft.studio.unit.height" value="px"/>
        <printWhenExpression><![CDATA[$F{level} == 3]]></printWhenExpression>
        <textField evaluationTime="Report" hyperlinkType="LocalAnchor">
            <reportElement style="HeadingLabel3" x="40" y="0" width="430" height="15" uuid="379fcff2-021d-4761-a89a-eeb772723b1b">
                <property name="local_mesure_unitheight" value="pixel"/>
                <property name="com.jaspersoft.studio.unit.height" value="px"/>
            </reportElement>
            <textFieldExpression><![CDATA[$F{label}]]></textFieldExpression>
            <hyperlinkAnchorExpression><![CDATA[$F{label}]]></hyperlinkAnchorExpression>
        </textField>
        <textField evaluationTime="Auto" hyperlinkType="LocalAnchor">
            <reportElement style="HeadingIndex3" x="470" y="0" width="45" height="15" uuid="a31e80f3-f1fa-4643-adbe-77a61c7b9051">
                <property name="local_mesure_unitheight" value="pixel"/>
                <property name="com.jaspersoft.studio.unit.height" value="px"/>
            </reportElement>
            <textElement textAlignment="Right" verticalAlignment="Bottom"/>
            <textFieldExpression><![CDATA[$V{PAGE_NUMBER} + $F{pageIndex} + 1]]></textFieldExpression>
            <hyperlinkAnchorExpression><![CDATA[$F{label}]]></hyperlinkAnchorExpression>
        </textField>
    </band>
</detail>

编辑:这是我的主要报告jrxml。

<property name="com.jaspersoft.studio.data.defaultdataadapter" value="TCD"/>
<property name="net.sf.jasperreports.print.create.bookmarks" value="true"/>
<property name="com.jaspersoft.studio.book.group.cover.header" value="Cover and Table of Contents"/>
<property name="com.jaspersoft.studio.book.group.cover.footer" value="Backcover"/>
<property name="ireport.jasperserver.url" value="http://localhost:8080/jasperserver/"/>
<property name="ireport.jasperserver.user" value="jasperadmin"/>
<property name="ireport.jasperserver.report.resource" value="/reports/TCD_book_page_files/main_jrxml"/>
<property name="ireport.jasperserver.reportUnit" value="/reports/TCD_book_page"/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<queryString>
    <![CDATA[SELECT 1 NO FROM DUAL]]>
</queryString>
<field name="NO" class="java.lang.Integer"/>
<group name="cover">
    <groupHeader>
        <part evaluationTime="Report" uuid="56ab525c-754f-4f48-a52c-7cc23934be3d">
            <property name="net.sf.jasperreports.bookmarks.data.source.parameter" value="REPORT_DATA_SOURCE"/>
            <p:subreportPart xmlns:p="http://jasperreports.sourceforge.net/jasperreports/parts" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/parts http://jasperreports.sourceforge.net/xsd/parts.xsd">
                <subreportExpression><![CDATA["TCD_book_page_toc.jasper"]]></subreportExpression>
            </p:subreportPart>
        </part>
    </groupHeader>
</group>
<detail>
    <part uuid="5196d1c8-d060-450f-b9f5-9089918b7389">
        <p:subreportPart xmlns:p="http://jasperreports.sourceforge.net/jasperreports/parts" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/parts http://jasperreports.sourceforge.net/xsd/parts.xsd">
            <subreportParameter name="REPORT_CONNECTION">
                <subreportParameterExpression><![CDATA[$P{REPORT_CONNECTION}]]></subreportParameterExpression>
            </subreportParameter>
            <subreportExpression><![CDATA["TCD_Page.jrxml"]]></subreportExpression>
        </p:subreportPart>
    </part>
</detail>

佩特·弗里伯格

http://jasperreports.sourceforge.net/sample.reference/tableofcontents/不工作,即使你有你的报表的书签。(例如,它们在子报表中)。

一些重要的注意事项:

主报告应设置net.sf.jasperreports.print.create.bookmarks以便在报告生成时收集书签。

目录部分需要其他报告部分之后进行评估如果要在文档的开头打印该部件,则应进行“报告评估”(以后的任何部分均不应具有相同的评估)。

如果不想使用jasper report的此功能,则需要生成自己的脚本来收集数据,例如:

我如何在Jasperreports中建立目录表

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何使用jasper studio 6.03在jasper报表中添加超链接

来自分类Dev

如何在jasper报表中的栏顶部显示标签,并留出一定的空间?

来自分类Dev

如何在jasper报告中添加按钮?

来自分类Dev

如何在CVS中添加目录

来自分类Dev

如何在PATH中添加更多目录

来自分类Dev

如何在CVS中添加目录

来自分类Dev

如何在仪表板SSRS中的子报表中添加参数

来自分类Dev

如何在Oracle Apex交互式报表的行中添加更新按钮?

来自分类Dev

如何在不使用databse的情况下在Crystal报表中添加动态图像?

来自分类Dev

如何在Visual Studio 2008中将下拉列表添加到rdl报表

来自分类Dev

如何在rdlc报表中为日期添加th,st,nd和rd?

来自分类Dev

如何在rdlc报表中将数据集参数添加到网址中

来自分类Dev

如何在VB 2010中为水晶报表添加条件

来自分类Dev

如何在报表中细分和汇总?

来自分类Dev

Jasper报表中的自定义GROUP BY

来自分类Dev

伺服中的Jasper报表会产生MalformedURLException

来自分类Dev

Jasper报表中饼图中的负值

来自分类Dev

将字段传递给Jasper报表中的子报表

来自分类Dev

如何在Jasper Report中向条形图添加水平线?

来自分类Dev

如何在目录中添加tar归档文件中的文件?

来自分类Dev

如何在Crystal报表字段上添加公式

来自分类Dev

如何在Rails的加载路径中添加服务目录?

来自分类Dev

如何在特定目录中的标签之间列出添加的文件?

来自分类Dev

如何在Kedro的目录中添加许多CSV文件?

来自分类Dev

如何在书本目录中向LabelView添加点(椭圆)

来自分类Dev

如何在主目录中添加mimetype图标?

来自分类Dev

如何在Div的背景中从项目目录添加视频

来自分类Dev

如何在Ubuntu上的Apache中添加用户目录

来自分类Dev

如何在目录中添加所有.pri文件

Related 相关文章

  1. 1

    如何使用jasper studio 6.03在jasper报表中添加超链接

  2. 2

    如何在jasper报表中的栏顶部显示标签,并留出一定的空间?

  3. 3

    如何在jasper报告中添加按钮?

  4. 4

    如何在CVS中添加目录

  5. 5

    如何在PATH中添加更多目录

  6. 6

    如何在CVS中添加目录

  7. 7

    如何在仪表板SSRS中的子报表中添加参数

  8. 8

    如何在Oracle Apex交互式报表的行中添加更新按钮?

  9. 9

    如何在不使用databse的情况下在Crystal报表中添加动态图像?

  10. 10

    如何在Visual Studio 2008中将下拉列表添加到rdl报表

  11. 11

    如何在rdlc报表中为日期添加th,st,nd和rd?

  12. 12

    如何在rdlc报表中将数据集参数添加到网址中

  13. 13

    如何在VB 2010中为水晶报表添加条件

  14. 14

    如何在报表中细分和汇总?

  15. 15

    Jasper报表中的自定义GROUP BY

  16. 16

    伺服中的Jasper报表会产生MalformedURLException

  17. 17

    Jasper报表中饼图中的负值

  18. 18

    将字段传递给Jasper报表中的子报表

  19. 19

    如何在Jasper Report中向条形图添加水平线?

  20. 20

    如何在目录中添加tar归档文件中的文件?

  21. 21

    如何在Crystal报表字段上添加公式

  22. 22

    如何在Rails的加载路径中添加服务目录?

  23. 23

    如何在特定目录中的标签之间列出添加的文件?

  24. 24

    如何在Kedro的目录中添加许多CSV文件?

  25. 25

    如何在书本目录中向LabelView添加点(椭圆)

  26. 26

    如何在主目录中添加mimetype图标?

  27. 27

    如何在Div的背景中从项目目录添加视频

  28. 28

    如何在Ubuntu上的Apache中添加用户目录

  29. 29

    如何在目录中添加所有.pri文件

热门标签

归档