Jump to content
JasperReports Library 7.0 is now available ×

space between subreports when new page


drosenbaum

Recommended Posts

Hi,

 

I have two subreports that print one after the other, but I would like a small amount of space (about 1/4 of a page) between them so it would not look crowded. So I am trying to accomplish:

Code:

Subreport1
<small about of space>
Subreport2

However, depending on how many detail rows Subreport1 has, Subreport2 may not print until the next page, as there may not be enough space at the bottom of the page to print a minimum amount. When this happens, though, the top of page 2 ends up with at least part of this small space and Subreport2 does not start until some ways down. I.e. it looks like this:

Code:
[code]
Page1:
Subreport1
<part of small amount of space>

Page2:
<another part of small about of space>
Subreport2

 

(But I do not always want to have a page break before Subreport2 because if lets say Subreport1 has only one detail record I do not want to waste the space on the rest of that page, I would rather just have a 1/4 page of empty space before Subreport2 begins on the very same page.)

 

Is there a way to instruct the report engine to only put empty space if Subreport2 would fit on the very same page, and if not and there is a page break before it don’t put any additional space at all? I have not able to figure out a way to do this.

 

Thanks in advance,

Daniel

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

I would like to add that I have even tried to use the dummy group trick to put both of my subreports in its own dummy group band but I am still having this issue.

 

Once again, is there a way to ask the engine to only put a space if the 2nd subreport starts on the same page as the first, otherwise don't put a space at all? I don't want a gap on the top of the new page.

 

Thanks,

Daniel

Link to comment
Share on other sites

  • 3 weeks later...

I am using 1.2.7 and my subreport has no margin. To create the space between the reports I resorted to creating an empty staticText box, as since I had a position type of Float the space was not being preserved otherwise. (But as a result the space always appears, even if a new page break is put in.)

 

Thank you,

Daniel

Link to comment
Share on other sites

There is actually another reason I created the blank staticText box. The 2nd subreport has a printWhenExpression and does not appear under certain circumstances. When this happens, I do not want empty space either between the end of the first subreport and the remaining content after where the 2nd subreport would have been.

 

This is why I cannot simply leave an empty space between the subreports but instead put a staticText box with a printWhenExpression the same as the subreports.

Link to comment
Share on other sites

  • 2 years later...

Hi

As a similar discussion was raised a while ago, I would like to resurrect the problem again because I could not find a solution of putting space between subreports properly. First let me describe my report, I have the following

Master Report

    [Each of my subreports is inside a dummy group]

     Subreport 1 [the content is dynamic which means the height of the subreport is increased/decreased dynamically and margin top and botton are set to 0]

    [space of 10]

    Subreport 2 [the content is dynamic which means the height of the subreport is increased/decreased dynamically and margin top and botton are set to 0]

    [space of 10]

     .....

    [space of 10]

     ......

    [space of 10]

    Subreport x [the content is dynamic which means the height of the subreport is increased/decreased dynamically and margin top and botton are set to 0]

Now, the problems are listed below

    a) When there is not enough space on a page, the subreport goes to the next page

    b) when problem a) happens, problem b) becomes a hell because it still puts the space of 10

    c) As I do not know how big each subreport will be, basically, there is no way I can assume the height of each subreport

    d) problem a,b, and c together create an absolute chaos because it seems no page, group, report or subreport property seem to make the master report to an ugly monster.

 

Now, I will be in great debt to all of you if you can give me a complete solution of my problem. Please HELP!


 

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