wjones14 Posted January 9, 2007 Share Posted January 9, 2007 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 More sharing options...
jmurray Posted January 9, 2007 Share Posted January 9, 2007 You would think that it would be a simple matter of setting the Stretch Type to "Relative to Band Height", but guess what... it doesn't work. Short of a scriptlet there doesn't appear to be a solution in iReport Link to comment Share on other sites More sharing options...
lucianc Posted January 9, 2007 Share Posted January 9, 2007 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 likeCode:<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,LucianPost edited by: lucianc, at: 2007/01/09 11:31 Link to comment Share on other sites More sharing options...
radix Posted January 9, 2007 Share Posted January 9, 2007 or if you have a fixed page size and want a fixed size border you can use background band, fully expand it and draw the frame with the size you want. Link to comment Share on other sites More sharing options...
wjones14 Posted January 10, 2007 Author Share Posted January 10, 2007 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now