Jump to content

Can Sub Reports be defined in the 'Title' band?


Robbio

Recommended Posts

It looks like when you define a sub report, that they may not be defined as part of the Title band - is this true? - why would that be the case?

 

I wanted to display a second title page to proivde additional space for my sql where clause (user provided) parameters. However, even though I spelled out the new sub report to print on a new page (as part of that sub reports definition), it never shows up.

 

I suspect that the subreport has to be associated with a group and a 'print when the group changes' needs to therefor be defined - is this supposition true? If so, I'm stuck based on how the current report is laid out - ie I am currently leveraging page/column headers along with pre-existing grouped footers...A new group header/footer would disrupt the existing layout.

 

Am I stuck creating an additional subreport for my reports content so that I can display 2 groups independantly - 1 group for my additional Title content and one group for my reports actual content?

 

So why cant the subreport work properly in the title band?

Regards,

 

~Rob.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Additional information...

 

I added a sub-report to my Title Band - passing in some parameters. I defined the subreport to display on a new page (in the report properties).

 

A result of which - I never saw my subreport printed - ie creating a second title page. I thought maybe this was a result of the sub report property stating print a blank page when theres no data...but I never saw that page at all.

 

Next I redefined the subreport property:

When there's no data in the sub report - which will be the case here, I specified to all sections should be disaplyed - no data. This resulted in an OutOfMemoryException - even though I specified a java option -Xmx1024M.

 

Not sure if this is a bug, but sure smells like one.

As soon as I reset the (sub) report parameter back to display a blank page when there's no data, the memory issue goes away, and I'm left with no second title page.

 

Any thoughts?

 

~Rob.

Link to comment
Share on other sites

I got this response - resolving my issue - it wasnt an IReport issue - perse, so I posted this on the JasperReports Discussion board...I got the following response that did in fact resolve my issue:

 

(Never occured to me to count my pixels between the main report and the subreport).

 

-from Lucian-

The infinite loop is caused by the fact that the title band of the subreport never finds enough space to render itself. More precisely: the master page height = 612 - top margin = 20 - bottom margin = 20 --> 572 left for the report content. The subreport has the same margins, so this leaves 532 for the subreport title, but the title band is 572 in height.

 

 

 

One way to fix this is to remove (set to 0) the subreport top and bottom margins.

 

 

 

HTH,

 

Lucian

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