jeanpierrepolnareff91 Posted May 22, 2019 Share Posted May 22, 2019 Hi everyone ! I'm new to jaspersoft and I wanted to create an interactive report (based on an AdHoc view) with a template so I followed this tutorial https://community.jaspersoft.com/documentation/tibco-jasperreports-server-ultimate-guide/v710/creating-new-report-template and at the end everything is working fine but my template don't display the correct number of pages (page 1 of 1 while there are 5739 pages !).Is there a solution to display the correct number of pages in my report ?/sites/default/files/user_uploads/jeanpierrepolnareff91/2019-05-22_10h22_53.png -> /sites/default/files/user_uploads/jeanpierrepolnareff91/2019-05-22_10h21_21.png Link to comment Share on other sites More sharing options...
Solution narcism Posted May 22, 2019 Solution Share Posted May 22, 2019 You need to use the "Page X of Y" palette component which is a composite element made out of two textFields with different evaluationTime setting for each. After you drop the component and inspect the JRXML you should see something like this in the Source tab:<textField> <reportElement x="354" y="14" width="100" height="30" uuid="5fa7916e-f99d-4bdf-b28f-fc08c8ed99f8"/> <textElement textAlignment="Right"/> <textFieldExpression><![CDATA["Page " + $V{PAGE_NUMBER}]]></textFieldExpression></textField><textField evaluationTime="Report"> <reportElement x="454" y="14" width="100" height="30" uuid="84dcff42-e5e3-4309-877c-020f91153bdc"/> <textElement textAlignment="Left"/> <textFieldExpression><![CDATA[" of " + $V{PAGE_NUMBER}]]></textFieldExpression></textField>[/code]EDIT: Regarding the repeating footer issue, this happens because the crosstab ends-up in a Summary band for which the footer band does not repeat when it overflows.To overcome this issue, once you have added the Page Footer band with the pagination textField(s) you need to set the report property:Summary With Page Header And Footer to true, in the Report Properties tab, in JasperSoft Studio, or manually edit the JRXML by adding:isSummaryWithPageHeaderAndFooter="true" to the top-level jasperReports tag:<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" ... isSummaryWithPageHeaderAndFooter="true" ... uuid="31ce6514-6e4a-4667-a352-02d0b047a48b">[/code] Link to comment Share on other sites More sharing options...
yfattibene Posted May 22, 2019 Share Posted May 22, 2019 Use these two bands (see image) Link to comment Share on other sites More sharing options...
jeanpierrepolnareff91 Posted May 22, 2019 Author Share Posted May 22, 2019 Thanks narcism, it seems to work now but my footer is only in the first page, not in the others.Is there a way to display my footer on each page of my interactive report ? Link to comment Share on other sites More sharing options...
narcism Posted May 22, 2019 Share Posted May 22, 2019 In what band did you place those elements? Link to comment Share on other sites More sharing options...
C-Box Posted May 23, 2019 Share Posted May 23, 2019 What band have you used for placing the PagerNumber variables? It should be the page-footer of the (main)report, as this is printed at every page at the bottom. By the way.... the "newer" versions of JasperReports have also a builtin variable $V{MASTER_TOTAL_PAGES} and $V{MASTER_CURRENT_PAGE} that you could place into just ONE textfield that you also could nicely align right, as the "two-field-logic" (suggested above by Narcism) always was a bit "buggy" when you would like to arange your page numbering on a right border/line or on other right aligned fields.So try you place your field into page-footer and use this as expression:"Page " + $V{MASTER_CURRENT_PAGE} + " of " + $V{MASTER_TOTAL_PAGES}[/code]hth + regardsC-Box Link to comment Share on other sites More sharing options...
jeanpierrepolnareff91 Posted May 23, 2019 Author Share Posted May 23, 2019 I placed them in the page footer band/sites/default/files/user_uploads/jeanpierrepolnareff91/2019-5-23_9-9-28.png Link to comment Share on other sites More sharing options...
jeanpierrepolnareff91 Posted May 23, 2019 Author Share Posted May 23, 2019 I tired your method C-Box but i got only page null of null output :/sites/default/files/user_uploads/jeanpierrepolnareff91/2019-05-23_09h35_53.pngBut even if it worked, I still have a problem, I can see my footer page only in the first page of the interactive report :/sites/default/files/user_uploads/jeanpierrepolnareff91/2019-05-23_09h36_11.png/sites/default/files/user_uploads/jeanpierrepolnareff91/2019-05-23_09h39_03.png Link to comment Share on other sites More sharing options...
C-Box Posted May 23, 2019 Share Posted May 23, 2019 You must set the EVALUATION-TIME of the TextField to "MASTER" ... that I've forgot to mention, sorry!And because of your missing PAGE_FOOTER at the second and ++pages ..... are you sure, that you placed it into the PAGE_FOOTER? is your Table/Data rendered later in a summary band? If so, just set at report-level, that the summary also should be printed with pageheader/footer.Otherwise just post your JRXMLhth + regardsC-Box Link to comment Share on other sites More sharing options...
jeanpierrepolnareff91 Posted May 23, 2019 Author Share Posted May 23, 2019 Thanks for your help C-Box ! The textField with MASTER variables works, but i don't know how to fix my other problem, I'll post the JRXML here and I will try to fix it later. JRXML File and code : https://we.tl/t-J5Ovzn9Eov Link to comment Share on other sites More sharing options...
C-Box Posted May 23, 2019 Share Posted May 23, 2019 Your jrxml just contains PageHeader and PageFooter... but no other elements on no other bands!?!?!? Have you deleted the CrossTab from it???? (as I see some crosstab styles at the beginning at the jrxml)regards againC-Box Link to comment Share on other sites More sharing options...
arnaudsimon091 Posted May 23, 2019 Share Posted May 23, 2019 I have the same problem jeanpierre, my page footer is only displayed on the first page Link to comment Share on other sites More sharing options...
jeanpierrepolnareff91 Posted May 23, 2019 Author Share Posted May 23, 2019 I haven't deleted crosstabs etc in my JRXLM C-Box, in fact I just followed the tutorial (https://community.jaspersoft.com/documentation/tibco-jasperreports-server-ultimate-guide/v710/creating-new-report-template)I have downloaded a JRXML template on the server and adapted it to my needs./sites/default/files/user_uploads/jeanpierrepolnareff91/2019-05-23_16h39_38.png Link to comment Share on other sites More sharing options...
C-Box Posted May 23, 2019 Share Posted May 23, 2019 Ok I forgot, that you are using the JasperServer and your posted design is just an Template ... I'm not familiar with that, as I just use the "good old" JasperReports library in standalone (ERP) Java applications.So I assume it's a bug .. or a feature!?!? Perhaps "adhoc" views were not designed to have multiple pages and are more for html "endless" scrolling thought!!?!?But as I said, here my knowledge ends - sorry guys.Perhaps a staff member or the "power poster" Hozawa has a solution!??!regardsC-Box Link to comment Share on other sites More sharing options...
jeanpierrepolnareff91 Posted May 24, 2019 Author Share Posted May 24, 2019 Indeed, it could be a feature, after all reports created in JasperReports Server aren't the same as those of Jaspersoft studio.I will try to reach Hozawa or a staff member, thanks you again C-Box for your help ! Link to comment Share on other sites More sharing options...
jeanpierrepolnareff91 Posted May 24, 2019 Author Share Posted May 24, 2019 By the way, is it even possible to display the footer page band on a each page of a JasperReports Server report ? (I assume that it doesn't work the same way as a classic jaspersoft studio report) Link to comment Share on other sites More sharing options...
jeanpierrepolnareff91 Posted July 23, 2019 Author Share Posted July 23, 2019 Thanks you very much narcism ! Everything works now with the isSummaryWithPageHeaderAndFooter set to true Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now