Blank space at end of page - jasper-reports

Background
A subreport with a column title and a detail section both set to 20px high.
When the subreport record displays on the main report, the subreport prints as expected until when it reaches at the bottom of the page.
Then the subreport prints just the column header and left blank space, then again starts on new page with column header and its detail.
Question
So, would you make it either print the whole subreport on same page, or start whole report from new page?
Master Report JRXML
http://pastebin.com/V2HRPWVL
Image of the problem faces
Thank You
Mihir Parekh

Another way to delete the last blank page that appears in the report, is eliminating the pagination of the report

Try set the Split Type of related band to Prevent. (Might be detail band)

Related

Detail band with page break

I have a report that contains a page break in the detail section .
in the first part of the detail section (before the page break) i have put a subreport containing an image.
When running the report i have two pages (as expected ) but the image is displayed in both pages.Is there a tip to display my image in the first page only?
To test i moved it after the page break and it worked correctly (displayed the image in the second page only). Why the first method is not working on the first page only?
I resolved this issue by putting the subreport in the Column Footer band, and in the "Print when expression" of the subreport I used this expression to display it in the first pages only:
new Boolean($V{PAGE_NUMBER}.intValue() % 2 != 0)

ActiveReports 3 - Underlay Next property gets section partially printed

I have a report that has two headers. On the top one I have a subreport on the right side, that shows the report's main data. On the header below, I have two subreports. The one on the left has tabular information while the one on the right has more form-type info. This last subreport is set to match the upper header report width and position on the page.
Now, the top header is set as UnderlayNext = true, so it gets printed side by side with the tabular report. All is well except when the footer section of the subreport on the left does not fit on the page it is supposed to be printed and is moved to the next page. When that happens, the upper header section only gets partially printed, with the same height as the footer section of the other report.
EDIT: Rethinking (but not retesting) I think that what's going on is that the section set to underlay next does not go beyond the next section, thus when the section is not large enough, it gets cropped. In my case, the second section is larger than the UnderlayNext (top) one, but as I have a new page and the top section is set to repeat on every page, it gets cropped too. Funny thing is that if I select the data on the generated PDF, the information IS there, just not visible.
It would be suggested to set the KeepTogether property to "True" and the GroupKeepTogether property to "All" of the GroupHeader.
Regards,
Mohita
What I finally did was to add an empty group footer section with size zero at the bottom of the report and set PrintAtBottom to true.

Jasper Reports subreport on a new page

I have a jasper report that consists of 6 subreports. Each of these subreports has its own title section. Now I need each report to start on the new page. I tried adding page breaks but it did not work for me.
While researching the problem I cam across a trick to set isTitleNewPage to true at
http://www.dzone.com/snippets/jasperreports-subreport-new. So I added the attribute isTitleNewPage="true" to all the subreports, but now the subreport's Title remains on the previous page and Details and Summary of that subreport are being displayed on a new page.
How can i solve this problem??
Simplest solution is to set runToBottom flag to true in subreport tags.
<subreport runToBottom="true">
This forces the subreport to fill the whole page, so the next subreport will start on a new page.
Flag isTitleNewPage won't do the trick because like you noticed, it will split the subreport's title band with the rest of the subreport content (unless you're using a blank title band).
In the initial tag:
<jasperReport
put:
isTitleNewPage="true"
I had the same problem that the title remains on the previous page.
But I have a solution:
put the stuff from the title in the "page header" band
set isTitleNewPage="true"
add a Integer variable to the subreport with the initial value 0
inkrement type "page"
expression $V{vari} + 1
print when expression of the page header is $V{vari} == 0
Now u have your title stuff on a new page, but only one time.
My solution to this problem is to add every Subreport in a separate "Detail band" and then set the Band height to the biggest possible value (right click on the "Detail X Band" => "Maximize Band Height"). Between bands could be printed some blank pages, but that is not a big problem in my case.
I solved it by add page break at the start of the sub report in the top side, no use "Print when expression" or anything else
Report formation:
Master Report -> 1st page -> 2nd page -> Sub report -> (add page break on top) title+ 2 sub report -> master report end page
Add a detail band for each sub report and go to the sub report properties and put a tick on Title on a new page.
I solved it by putting a page break at the beggining of each subreport, just before the title label and set 'new Boolean (true)' on the 'Print When Expression' property for each page break.

Border in Detail band

I have a question about how border should display in detail band, and I would like to get some help.
Say, a column in detail band that might have LOTS data, by lots, I meant sometimes a single record might actually took 2~3 page to display.
Now customer ask that we should make report always display bottom line of the border as long as it meets end of page (even this record its not end yet)
What I tried:
Make a column footer with 1px height line.
Set "Floating column footer" to TRUE.
Result : It works great, but this line will make extra empty space at end of the table if there is a Summary band after the column footer. I think I am close, but I just can't get rid of the strange empty space
Make a Frame with border, set "Print when detail overflow" to TRUE then put everything in detail band into this frame.
Result : Not work as I expected :(
Since this report contains not just a table in detail band, and the height of the table are random. Tricks like a border in Background or Page Footer are not suitable here
What else can I do ?
There is a PrintWhenExpression trick that can help with the page footer:
How to hide Page X / Y when report is 1 page ? - JasperForge Forum
The trick is to put a flag in the Report Parameter Map, then use the flag to decide whether text (or fields, lines, etc.) should be printed.
To use a line in Page Footer there will always be some pages with extra line. In this case, the report is always starting from page 1, and the table in the report always end before printing the Summary band. That means, the line is no longer necessary as long as Summary band has been reached. Thus:
Add a line in Page Footer with PrintWhenExpression :
new Boolean(!(Boolean.TRUE).equals($P{REPORT_PARAMETERS_MAP}.get("stopFlag")))
Then make a dummy textField in Summary band with PrintWhenExpression like this :
$P{REPORT_PARAMETERS_MAP}.put("stopFlag",Boolean.TRUE)
This trick works, but might need some tweaking for different layouts.
The option given by Dave is right.
If you care about the space still being used, then set the band and textfield heights to zero.
In my case using Dave's option worked (and I needed no extra space to be used).
I put this as PrintWhenExpression in the fields I just wanted to show in the last page:
$P{REPORT_PARAMETERS_MAP}.get("lastPage")!=null
And this as PrintWhenExpression in a 0-height textfield in the 0-heigth summary band:
$P{REPORT_PARAMETERS_MAP}.put("lastPage",":)")
When it comes to page termination the options are limited. Its made even hard because if you have items that do not display when null it still assumes that space is used.
I would stick with messing around with the column footer or page footer as your best options.

Problem in Report Design Layout

I have a jasper report with 4 subreports in the detail band of the master report.
If data is available for first subreport, it starts displaying from page 1 with the header of the subreport. When second subreport starts printing data, it prints only header in page 1 and the page breaks and in the page 2, it prints header again n data for that.
I dont want the header of the second subreport to be printed in page1. It should start print in the page 2.
How to solve this..? How could i page break...?
its urgent.Please help.
Thanks in advance,
Prasanna
First start by separating each subreport in its own band. ie. Make a new group for each new subreport.
In the Add/modify group dialog, there is an option called Print Header on each page, try to check that