Print when last row on table Jasper report

纵然是瞬间 提交于 2019-12-25 05:19:25

问题


I have a report that needs to have an image printed only in the last row of the table of each page. How can I create my print when expression?

Edit:

Sorry for my poor exemple.

until now, i created this variable

<variable name="rowsOnPage" class="java.lang.Integer">
        <variableExpression><![CDATA[$V{rowsOnPage} + 1]]></variableExpression>
        <initialValueExpression><![CDATA[0]]></initialValueExpression>
</variable>

and i try this print when expression:

$V{rowsOnPage} == $V{REPORT_COUNT}

But this expression print the image in each row of table.


回答1:


As Petter says, providing an example of what you've tried and how close you've got so far would be helpful.

In the meantime my suggestion is that you add a max rowcount value to your SQL and return this as field in your JRXML as e.g. maxRowNum. With this you could then use a printWhen at the point when $V{REPORT_COUNT} == $F{maxRowNum}

This assumes you have access to the SQL part of your code and can play with this.



来源:https://stackoverflow.com/questions/44034002/print-when-last-row-on-table-jasper-report

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!