Jump to content
Changes to the Jaspersoft community edition download ×

Arranging sub-reports


harishsundaram

Recommended Posts

Hi

 

I am new to jasper reports and am currently struggling with sub-reports. I'm using jasper reports 1.2.4

 

I have a master report with more than 20 sub-reports. However, I'm not able to make each sub-report start on a new page.

How do I make sure that each sub-report starts on a new page?

 

Thanks in advance,

~Harish

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

 

You could put each subreport in its own band by using the group header sections of 20 dummy groups that break with every record and have minHeightToStartNewPage big enough so that the each group always starts on a new page.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

  • 3 years later...

Hi,

 

In this particular case, what we call dummy group is actually a group that breaks with every record. Such a group, would print its header and footer with every record in the data source, thus giving you more bands to leverage as detail.

A group that breaks with every record has to have a group expression that changes with every record.

This is such an expression:

 

<groupExpression>$V{REPORT_COUNT}</groupExpression>

 

I hope this helps.
Teodor

 

Link to comment
Share on other sites

hi teodord,

first of all thank you for replying to me,  i want to describe to you my problem, i have a JRBeanArrayDataSource that i move it to the report, this array contain details, for an example, let's say for a school's teachers and students:  name , telephone and type (student or teacher). 

so i want to print in a table(band) all the teachers then after that all the students! (it's just an example):

this is the teacher's of this school:

A  # 

B #

...

this is the student's list:

s #

b #

===============================================================================

now i try different idea's But i couldn't succced,

1. i think may i use groups to do so but because group need Order by in sql and i don't have an sql - am moving JRBeanArrayDataSource to ReportDataSource.

2. i thought i can use one main report and one subreport but then i face the same problem the subreport print all the students alone but the some of the teachers is printed before and after the subreport.(why?)  , i have tried to use two group footer but i face the same problem.

3. i think about using one empty main report and using two sub-reports but i face another problem that the subreports is printed on each other - i try using the "dummy group" with <groupExpression>$V{REPORT_COUNT}</groupExpression

but i don''t know what i did wrong.

 

please help me ASAP!

thanks in advance.

 

 

 

 

  

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