SSRS - Semi-Blank page when Tablix exceeds page1 space - ssrs-2008

My Title to this question is probably a little confusing, but let me try explain what happens.
Our company report template requires a header and a footer. The footer is displayed on every page, but the header should only be displayed on page 1.
To achieve this, we removed the header content from the report header and placed it at the top of the report above the Tablix. This produced the desired results, but we now have the issue where we get semi-blank pages.
Some background:
- The header of page 1 takes up about 5cm of the page.
- There are no overlapping controls on the page.
- InteractiveSize property: 21cm, 29.7cm
- Margins property: 1cm, 1cm, 0cm, 0.5cm
- PageSize property: 21cm, 29.7cm
Now lets say on page 1, there is X amount of space for the tablix data (Because of the header), but from page 2 to the end there is Y amount of space for tablix data.
The problem we get is when the total amount of data that should be rendered is between X and Y. The report then renders the 1st page with the header, but apart from that and the footer, the page is blank. Then on page 2, the Tablix will display the data.
If the amount of data is less than X or more than Y, then we have no problems; the report renders as expected.
Can anyone maybe point me in the right direction please?
Thanks

It sounds like the tablix's KeepTogether property is set to True so that when there isn't enough room on the first page but there is on the second page for the entire tablix, it then renders on the second page.
Set it False

Related

Document band Occupying white space when not printed

I need to print a set of information on the bottom of my document's first page (right after detail band). Since the information printed on detail is too large, the document creates a pagination to display the rest of the information, but independent of what I use (Group,ColumnFooter,PageFooter,etc) to print the information tha should be printed on the first page only, this band keeps occupying a white space on consequent pages.
You can create a dummy group that would break with every record, but only while we are on the first page.
Such group would not have a group header or footer, but would use minHeightToStartNewPage with a value that would match the taller page footer required on the first page.
The group expression would look like the following:
$V{PAGE_NUMBER} == 1 ? $V{REPORT_COUNT} : null
This dummy group would cause a page break to occur upper on the first page, leaving more space for a larger page footer.
Now, the second trick is to place content in the page footer section, but at a position having a negative Y coordinate. By doing so, you can keep the height of the page footer section small, while being able to render content above it.
This content having negative Y inside the page footer would be printed conditionally, only on the first page, using the printWhenExpression.

Footer printed when page number is pair. Leaves blank space on other pages

I'm having some issues with JasperReports. I have a page footer that only prints when $V{PAGE_NUMBER}.intValue() % 2 == 0 .
This works correctly, but the main issue is that the page footer always occupies its fixed height, wether it is printed or not.
This behaviour makes me really sad, because my boss wants "these to be done well and for yesterday", but that extra space on unpair pages is making my reports not really very good looking: my page footer is really tall (height of 200px, more or less) and the blank space it leaves on odd pages is too big.
I tried almost everything I could read regarding this issue, but couldn't find a solution. I tried to move the contents of the page footer to a detail band and try to print that band at the bottom of the page when the page number is odd, but this solution didn't really work.
I would appreciate any kind of help. Please reply or my boss kills me.
The pageFooter and columnFooter are bands that do not allow overflow, the report engine calculates there size not on content but on band height which means that they will always be present with the band height you set...
Quoting Teodord jasper report staff
"I'm afraid there is no solution for what you want to achive"
This is in fact why jasper report introduced lastPageFooter, to enable the possibility to have a footer only on last page. Furthermore there was a feature request for firstPageFooter.
But it has been closed, no changes required, use negative coordinates, background band...
Conclusion:
You need to re-think you report structure, is there any logical grouping on which you can add a groupFooter you can stack it to the bottom footerPosition="StackAtBottom", or leave it as it is and go home ; )
Don't try to foul jasper report by grouping on $V{PAGE_NUMBER}.intValue() % 2 == 0, unfortunately it will not work..., you need to find
a logical grouping within your fields (data) or
on the number of records present in page $V{PAGE_COUNT}>20 or
something like $V{PAGE_COUNT}>15 || ($V{PAGE_NUMBER}%2==0 && $V{PAGE_COUNT}>10) that actually works breaking differently every odd page, leaving you the space after 15,10 records.. (note space is not really controlled if you isStretchWithOverflow="true" on the textField in detail band)
so go home....

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.

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.

Blank space at end of page

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)