Jump to content

Document of various pages


jaumeg

Recommended Posts

Hi all,

 

Can you say me if can I with Ireports define a Report of 8 pages.

 

What I need to do is a document of 8 fixed pages with images (jfreechart). PDF output.

 

any suggestion ? another Open SOurce for doing this ?

 

Thanks in advance for your help

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Use a subreport for each page.

You have to set the report property "when no data" to AllSectionsNoDetail.

 

Use the title (or the summary) band as single big band to place your objects.

 

In the master report, add your subreport in the detail band (the height of the subreport elements does not matter, so set it to... let's say 10 pixel).

Put a page break between each subreport.

 

A little sample is attached.

 

Giulio [file name=multipage.zip size=3937]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/multipage.zip[/file]

Link to comment
Share on other sites

jaumeg ,

 

You could explore the use of SUBREPORTS.

I would suggest creating a separate subreport file for each of your report sections... if you have 8 sections, you need 8 separate .jrxml (and .jasper) files. You will also need one MASTER REPORT file (.jrxml and .jasper).

 

You will have to create subreport elements in your master report. Each of these subreport elements must be linked to a corresponding subreport's .jasper file (NOT .jrxml).

 

If you also want each of your subreports to start on a new page - well, see if this works:

 

First of all, you should make sure that the report width of each of your SUBREPORTs is AT MOST (including margins if any) equal to the internal width of your MASTER REPORT's detail band (within margins).

 

In the like manner, make sure that the report height of each of your SUBREPORTs is AT MOST (including margins if any) equal to the MAXIMUM height of your MASTER REPORT's detail band - that is the MASTER REPORT's height (see Edit > Report Properties) less the heights of other bands that you are using in your master report.

 

Adjust the spacing between your subreports as needed. I'd suggest first trying no spaces between your subreports and see what comes out.

 

I have tried this only once as a test case but I have not used this often enough to know if it works for different cases. :)

 

This is, admittedly, not the best solution to force page breaks between subreports.

I still don't a better way to do this but I'm sure there is one out there.

 

I hope this helps.

 

 

Edwin

 

 

PS:

Giulio's solution above looks better.

Post edited by: edwin, at: 2007/04/17 17:23

Link to comment
Share on other sites

Does the single master report contain all seven subreports? Or does each report/subreport contain a single subreport at the end of it?

 

(Does it even matter?)

 

You could explore the use of SUBREPORTS.
I would suggest creating a separate subreport file for each of your report sections... if you have 8 sections, you need 8 separate .jrxml (and .jasper) files. You will also need one MASTER REPORT file (.jrxml and .jasper).
Link to comment
Share on other sites

rclarke88

You could do that either way.

From what I've read, I've learned that JasperReports does not have any limit on the number of nesting levels for subreports.

So, I assume that - depending on your preferences and requirements - you should be able to nest your subreports into whatever structure you like.

In that case, it matters only when it matters to you. :)

 

One thing you might want to know, I remember replying to a post about the maximum limit of subreports.

The message was posted by "feliciayong" on 2007/04/05 17:10 Max limit of subreports within main report.

Check out this thread if you have time to do so.

 

Edwin

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