Jump to content

Page Break and Data Problem


tinti

Recommended Posts

 I have a report with one subreport.

Something like this.

MasterReport.jrxml
SQL > select name from user

=Header
    TextField > name
=Detail1
    Subreport > Subreport.jrxml
=Detail2
    pageBreak
=Footer
    TextField > name

Use for reference this table as a result from the MasterReport select.

NAME
--------
Darth Vader
Yoda
Johnny B Good

And now the Subreport.jrxml
SQL > select 1 from dual

=Detail
Empty space or a Static Field, whatever.

So, the problem is that the user name, wich should apear on header and footer is diferent for each page and aparently the problem is about the pagebreak and the subreport. I've done some tests with the MasterReport without the subreport, but with a pagebreak at the end of the detail band and the report printed normaly. But with the other detail and the pagebreak, the report goes crazy and print something like this.

Page1
=Header
Darth Vader
=Detail
=Footer
Yoda

Page2
=Header
Yoda
=Detail
=Footer
Johnny B Good

Page3
=Header
Johnny B Good
=Detail
=Footer
Johnny B Good

The data is wrong on the footers of all pages. It should be the same as the header, but it is not printing that way.
Am i doing something wrong?

Att,
Angelo Tinti
 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I've done some tests and aparently the problem is with the stretch propertie. When i set the detail2 height to 0 and put a subreport (the element, not the report) in there with height 0, the preview of the report goes crazy and print the footer with the wrong informations. But, if i set the detail band with the size of the subreport (the sum of all details on the Subreport.jrxml), and i set the size of the element subreport with the same value, it works.
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...