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

ireport and multi-page "static" texts?


vincent.keunen

Recommended Posts

Hi all,

 

I'm trying to convince coworkers here to use JasperReports + iReport but they tell me that some things can't be done. Can you confirm it's impossible or tell me how to do it?

 

We need to build a report that is mainly static (several pages of text). Inserted in the text are some data fields (easy to do). But the problem seems to be that it's impossible to build, with iReport, several pages of text. It seems to work well for creating a one page report that repeats (and then span on several pages). But it's quite different from building a several pages long report.

 

I know subreports can be used but this will not work here, I believe, because the several pages long text needs to flow from page to page depending on the length of inserted data fields...

 

Another question: is there a possibility to insert a "page break" instruction in jasperreport (with iReport preferably)?

 

Thanks for any help!

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

It can be done, and relatively easily using a static form or deriving the entire content from a data source.

 

 

In the Detail section of a report you can stack elements vertically as well as horizontally. The trick is getting them to resize and reposition themselves as other objects resize around them.

 

 

Imagine three Fieldboxes that contain a large amount of static text stacked vertically in the Detail section, like this:

 

 

+---------------------------------+

| blah, blah, blah, blah, bla... |

+---------------------------------+

+---------------------------------+

| nag, nag, nag, nag, nag, ... |

+---------------------------------+

+---------------------------------+

| whine, whinge, whine, wh... |

+---------------------------------+

 

 

They can all be set to be as wide as each paragraph needs to be, but can be left very short. They don't need to be (vertically) sized to the amount of text because the JasperReport engine will be told to reconfigure the layout on the fly.

 

 

The first one has it's Position Type set to "FixedRelativeToTop", the other two are set to Float. This lets the second and third Fieldboxes move as the others resize.

 

 

Then all three of the textboxes have these attributes set:

 

* Stretch Type: No Stretch

* Stretch with Overflow: checked

 

 

Seems counterintuitive to stretch with data overflow, but to have a Stretch Type of "No Stretch", but if you set any other value for Stretch Type then Floating elements will no display properly.

 

 

You should also make sure that the "Split allowed" band property is checked if you want data to simply spill over onto the next page.

Post edited by: jmurray, at: 2006/12/20 02:37

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