Jump to content
Changes to the Jaspersoft community edition download ×

Page break if detail spans page


ckell

Recommended Posts

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

I as newbie, I'm not sure what you mean by page/code termination (not yet accustom to iReport terminalogy.)

 

Basically, I don't want the output for a student to span two pages. For example, student "A's" imaging begins near the bottom of the page, and continues onto the next. I'm wishing to avoid this. For this situation I want a page break to occur prior to imaging student "A" so that student "A's" data appears at the top of a new page.

 

Thanks for your interest in helping.

 

-chris

Link to comment
Share on other sites

ckell,

 

i have not used page breaks before but here's what i think you could try out:

insert a page/column break at the point where you want to start a new page (based on your conditions).

you could do this by

- clicking Edit > Insert Page/Column Break. you will then see your cursor turn into cross-hairs.

- click the cross-hairs at the point where you want to break (before a report section maybe).

 

next, make the properties dialog box for the page break element appear.

do this by

- right clicking on the page break element that you just positioned.

- then click the Common tab... you will see the Print when expression text box below.

- now, based on what your conditions are (and you must be very clear on what they are for it to work according to how you want it to work), type your boolean expression in here. this will control WHEN or IF your page break element should display (meaning "break the page").

 

you know what, since i'm doing a report that's very long, i'm going to give it a try and see if my theory will work... then i could use it if it works :)

 

hey, don't worry about being a newbee here... you'll get better at using iReport as you go along... one day you'll realize that you've gone a long way. everyone here is out to help in their own humble way. in time, sooner than you think, you will be able to do this too.

 

i'll let you know how it goes... let me know how you do on your end.

 

 

Edwin

 

Post edited by: edwin, at: 2007/05/14 20:49

Post edited by: edwin, at: 2007/05/14 20:50

Link to comment
Share on other sites

  • 6 months later...

I'm sure I am overlooking some basic fact about the <break> element here so wanted to post and hopefully get my confusion cleared up. I created the attached sample report that illustrates my problem. It is a LONG detail band that is longer than 1 page and has a break element roughly 20px above where the first page ends. I tried to view it to see the break in action but I get the error:

Code:
net.sf.jasperreports.engine.design.JRValidationException: Report design not valid : 
1. The detail section, the page and column headers and footers and the margins do not fit the page height.
at net.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:260)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:144)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:220)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:153)
at com.test.ReportRunner.main(ReportRunner.java:21)

 

Shouldn't I be able to use the break element this way? Detail bands can span multiple pages normally, so wondering how i can design my report 'pages'. I really want to avoid using any work arounds as I really embraced the break element to avoid the usual group header-page workaround.

Link to comment
Share on other sites

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