Jump to content
We've recently updated our Privacy Statement, available here ×

Page number on summary band?


saman0suke

Recommended Posts

Hi guys, I have a problem ,and I don't know how to solve it, I'm creating a report with 5 subreports, all of them in the summary band, and a "main" table in the Detail band, everything is working, except for the page numbers, because I put them in the PageFooter band but they are only visible on the first page (Detail band), and when the summary starts on the second and third page(in my case) I cannot see the page numbers, is there any way that I can add page numbers on Summary band? I'm using iReport 3.0.0, thank you, and have a nice day.



Post Edited by saman0suke at 01/05/2011 21:57



Post Edited by saman0suke at 01/05/2011 21:57
Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

In the Report Inspector pane, try selecting the root node of the tree (the name of the actual report).  Then, in the Properties pane, check the box "Summary with Page Header and Footer.  I didn't realize it before, but apparently

"By default the summary band has not the page header and footer.  With this property it is possible to force to print the page header and footer in the summary band (in general when this band appears on a separated page)."

Hope that helps,

Carl

Link to comment
Share on other sites

  • 1 month later...

Hi,

I'm having the same problem, i tried this solution and i got this exception:

com.jaspersoft.jasperserver.api.JSExceptionWrapper: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'isSummaryWithPageHeaderAndFooter' is not allowed to appear in element 'jasperReport'.

By the way i am using iReport 3.7, JasperServer 3.5... Any ideas about this exception?

Link to comment
Share on other sites

Sounds like it must have been a newer feature.  You can use the compatibility mode to try to keep you from generating any code in iReport 3.7 that won't run in JasperReports Server 3.5, but then of course that still doesn't solve your original problem of wanting to have the header and footer appear on the summary page.  Hence the enhancement.

Unfortunately, I don't know of a good way to fake the enhancement prior to updating to 3.7 on the server side.

Carl

Link to comment
Share on other sites

Thanks Carl,

 

I am wondering if is there a way to "trick" this type of behavior for jasper 3.5, i am new on ireport and i am trying to speed up myself to get all this knowledge asap or if is there a documentation that you can recommend. I will appreciate your advice

Link to comment
Share on other sites

  • 3 years later...

Ok this answer comes a bit late to all users of iReport 3.0.0 / all iReport versions without enhanced features.

 

First create a parameter "pageLast" to be passed from the main report to the summary sub-report.

Pass $V{PAGE_NUMBER} of the main report to the parameter.

 

Then create 2 text field boxes just like you would for the normal page numbers in the sub-report.

1st box: "Page "+new BigDecimal($P{pageLast}.doubleValue()+$V{PAGE_NUMBER}.doubleValue()-1)+" of"

2nd box: " " + new BigDecimal($V{PAGE_NUMBER}.doubleValue() + $P{pageLast}.doubleValue()-1)

 

Finally, in your main report, make the sub-report as big as it can go (i.e. until the program tells you it's too big).

This ensures the sub-report's page numbers are correct, meaning it only works for single sub-reports.......i havent tried multiple sub reports yet.

 

Link to comment
Share on other sites

  • 1 year later...
  • 2 years 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...