I want “continue…” text when sub report will overflow to new page

安稳与你 提交于 2020-01-11 11:56:53

问题


I think, this should be a feature, when the subreport detail band overflow to the next page, that "...continued" or something should came, but I can't able to solve that issue and I have tried to find out, if there is any solution, but nothing works..

Can any one have a better idea, how to get the solution?


回答1:


The "normal" way to do is:

In subreport put the text in the detail band (if it is not there already), if text without datasource (just pass a new net.sf.jasperreports.engine.JREmptyDataSource(1) to the subreport so that detail band is displayed one.

Having text in detail band allows us to use the pageFooter band, note title band and summary band overflows on new page without the pageFooter. You can also use the summary band but then you need to set attribute isSummaryWithPageHeaderAndFooter="true" on jasperReport tag.

In subreport add the a pageFooterBand with your text

es.

<pageFooter>
    <band height="50">
        <staticText>
            <reportElement x="446" y="18" width="100" height="20" uuid="efa2e741-c546-4261-bdb7-a4b211212f17"/>
            <text><![CDATA[...continued]]></text>
        </staticText>
    </band>
</pageFooter>

This will display the text "...continued" on every subreport page, since we like to avoid it on last page add empty lastPageFooter

<lastPageFooter>
    <band height="50"/>
</lastPageFooter>


来源:https://stackoverflow.com/questions/31562288/i-want-continue-text-when-sub-report-will-overflow-to-new-page

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