Print when last row on table Jasper report

2019-09-14 19:05发布

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条回答
闹够了就滚
2楼-- · 2019-09-14 19:26

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.

查看更多
登录 后发表回答