Jump to content

OutOfMemory Exception : Subreport in the Title


Robbio

Recommended Posts

My original goal was to try and print 2 title pages due to the users wanting to see all of the reports criteria and it was overflowing...

 

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 there's 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 that 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.

 

BTW:

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?

 

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?

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi,

 

This looks like an infinite loop problem due to some layout issues with the subreport.

It seems like the subreport overflows onto a new page no matter how many new pages the engine starts.

 

To pin-point the cause we would have to see the templates involved. You could attach them or a simplified version of them, to this post.

 

Thank you,

Teodor

Link to comment
Share on other sites

Thanks for the response - I've attached both my jrxml files as well as my compiled jasper files for your consideration.

 

My main report is called: Tally.jrxml

The subreport is called: FDID_List_SubReport.jrxml

 

 

I cannot tell for certain if my files are attached properly here, so let me know if I need to zip them up and attached just the zip file.

 

~Rob.

Link to comment
Share on other sites

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

Thank you LucianC.

 

That seems to have solved my issue. Kind a tough one to find - inspecting the pixel count that is. Seems strange it would span an infinite loop...Thanks, I'll pay closer attention to my pixel counts (where subreports are concerned) in the future.

 

Thank you!

 

~Rob.

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