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

frame around two subreports


wjones14

Recommended Posts

I have a report that has two subreports, one on top of the other, both floating. Then with iReport, I dragged a frame around the two subreports. The frame has Thin border.

 

But, when the report displays, it only surrounds the column header of the first subreport.

 

Do I have to edit the .jrxml file manually to make the frame surround both subreports? (not even really sure how to do that to be honest)

 

 

Thanks,

 

Bill J.

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Bill, what you need to do is to make sure that the subreports are placed inside the frame, as opposed to the frame overlapping the subreport elements. You can see this in iReport's document structure pane: if a report element is embedded in a frame, it will appear as a child of the frame element in the document tree; otherwise it will be a sibling of the frame.

 

The fact that both these cases exist poses problems to iReport. It seems that when you draw a frame around a group of report elements, it does not embed the elements inside the frame. Also, there seems to be no mechanism to explicitly embed an element inside a frame. The winning solution for this is to first create the frame and then create report elements inside the frame. (I'm not an iReport expert, these affirmations are based on empirical observations only.)

 

As you mentioned, you can also do this by directly editing the JRXML file. Your JRXML would look something like

Code:

<subreport ..>
..
</subreport>
<subreport ..>
..
</subreport>
<frame>
<reportElement ../>
<box ../>
</frame>

 

You need to move the subreport elements (and any other element which should be inside the frame):

Code:
[code]
<frame>
<reportElement ../>
<box ../>
<subreport ..>
..
</subreport>
<subreport ..>
..
</subreport>
</frame>

 

Regarding Stretch Type = "Relative to Band Height", I also have doubts that it would work. You can do this with a rectangle, but frames usually only stretch to accommodate elements embedded inside them.

 

Regards,

Lucian

 

HTH,

Lucian

Post edited by: lucianc, at: 2007/01/09 11:31

Link to comment
Share on other sites

Thanks Lucian, your suggestion about creating the frames first, and then putting things inside them works! The iReport Document Structure pane also shows the elements as nested inside the frames when done this way.

 

Instead of starting over though, I found that I could simply use iReport to cut the elements, select the frame, and then paste. This puts the elements inside the frame. Then you can drag the elements inside the frame to the position you want.

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