Jump to content
Changes to the Jaspersoft community edition download ×

variable number of subreports + resize band


2005 IR Help

Recommended Posts

By: breskeby - breskeby

variable number of subreports + resize band

2004-07-22 06:15

hello, i create my masterreport in javacode. in the detail-section of the masterreport i want to add dynamically subreports. because i don?t know the number of subreports and their size, i have not idea what size my detailband should have. how can i set the size of the detailband depending on the whole size of all included subreports?

 

my second idea was to fill a datasource with subreports and their parameters/datasource. has anybody experiences with that? or isn?t it possible?

 

grz brs

 

 

 

 

By: C-Box - c-box

RE: variable number of subreports + resize ba

2004-07-22 06:27

Well You shouldn't put all your SubReports into the detailband... just create for each subreport you will put dynamically into a new group. So if a SubReport hast to get placed into your MasterReport just create a new group and put your SubReport into the groupheader of that group and make the groupfooters height to cero.

 

Therefor you don't know how big a SubReport will be, you needn't think about... because if you place all your fields within the SubReport in it's detailband (or groupheaders/footers) they will strech by themselves.... so it should be enough to create a new group for each needed SubReport and make the size of the groupheader for instances 5 pixel, and the SubReport you place into also 5 pixel (and the groupfooter to 0 pixel).

 

It should work. Using groups prevent you from overlapping the subreports by each other.

 

hth

C-Box

 

 

 

 

By: breskeby - breskeby

RE: variable number of subreports + resize band

2004-07-23 00:31

so if i understand you correctly, my number of groups, is the number of subreports i have? right? but the new group i create for every subreport must be added to the detailband? correct? greez brs

 

 

 

 

By: C-Box - c-box

RE: variable number of subreports + resize ba

2004-07-23 01:32

Yes your are right with the numbers of SubReports is equal to the number of groups.

 

But NO YOU ARE wrong with placing the groups into the detailband... the groups consists always of a GROUPHEADERBAND and a GROUPFOOTERBAND... these both bands are surrounding the builtin detailband... if you need just one groupband (for instances in your case the groupheader) then you make the groupfooters height to cero.

 

For each SubReport you should have one corresponding groupheader.

 

So you can "abuse" the groupheaders as a kind of "detail enlargement"... that is also written down on JasperReports Homepage in the "Tips and Tricks section".

 

hth

C-Box

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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