Jump to content
Changes to the Jaspersoft community edition download ×

Problem in my interactive report


Go to solution Solved by narcism,

Recommended Posts

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

  • Replies 16
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

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

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 + regards

C-Box

Link to comment
Share on other sites

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.png

But 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

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 JRXML

hth + regards

C-Box

Link to comment
Share on other sites

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 again

C-Box

Link to comment
Share on other sites

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

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!??!

regards

C-Box

Link to comment
Share on other sites

  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...