Page Breaks within tablix (SSRS 2008)
Hi,
page breaks seem to be a real issue in SSRS, according to the number of posts, but I haven't found a solution for my problem yet.
My report contains a tablix which is used to group the data by keys. The tablix has one column and one row, and this cell contains several subreports which get their data from another table depending on the keys of the groups. This works quite well. However,
I would like to insert a page break in between the subreports. I tried inserting a rectangle with the PageBreak property set to Start and/or End, but this is ignored. Page breaks in the subreports themselves are also ignored. Having the subreports in rectangles
with PageBreak property set to Start or End is ignored as well.
The only way I have found to force page breaks is cross-joining my query of the main report with a table containing page numbers, add the page number field as the last grouping in SSRS and check the "Page breaks between each instance of the group", then
showing or hiding the subreports conditionally depending on the page number retrieved from the database. However, this obviously multiplies the amount of retrieved data by the number of pages and is therefore a rather slow approach.
How can I insert a page break between rows of a tablix or even within one row?
We are using the Report Viewer control in local processing mode, if that helps.
Thank you,
Kind Regards,
Roland
September 27th, 2010 5:58pm
Hi Roland,
Is it possible to paste a picture of your layout here or the link? I have used subreports withing a tablix like shown in the link below
http://road-blogs.blogspot.com/2010/05/creating-navigation-panel-for-reports_1992.html
but then I made one row for each subreport and hence I could make the pagebreaks.
Cheers,
Jason
P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)
Free Windows Admin Tool Kit Click here and download it now
September 27th, 2010 6:13pm
Hi Jason,
sure, here's the link: http://www.mediafire.com/?f38y7qbf43n1l
The first file is the screenshot of the design, you can see the six levels of grouping the tablix has. The second subreport contains two charts and they are supposed to be on the second page. The subreport is contained in a rectangle which has its PageBreak
property set to "Start".
However, as you can see in the second image, the page break is not executed, everything is displayed on the first page (setting is "Whole Page").
Thank you for your help!
Roland
September 27th, 2010 7:06pm
Hmm, if you had kept it in a rectangle, it should have worked. Could you try putting both the subreports in a matrix as shown in the eg below
1) Then, make a matrix below and drag & drop a subreport from the toolbox to the cell section of the matrix. Right click
on the subreport and select subreport properties.
2) Select
the subreport name that you want to display from the drop down list.
Do
steps 1 and 2 for each of the report that you need to display in the navigation panel.
3) Right
click on each of the tablix, select the tablix properties and tick the ‘add a page break before’ option. Also make sure that there is a dataset name associated with the tablix, else it would throw an error when we preview. Just make a dummy dataset
for this purpose if it is not already there.
Note
that I have deleted the header row of the matrix. Even though this is not necessary, I did it to reduce the spacing between the start of the page and the subreport.
4) Make
sure that border lines of the tablix have been made invisible.
Cheers,
Jason
P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)
Free Windows Admin Tool Kit Click here and download it now
September 27th, 2010 7:29pm
Hi Jason,
I tried this but unfortuanately, if I check the "Add a page break before" option of the tablix, it creates a page break before the first subreport is rendered but not in between the subreports. Or did I miss something?
Thank you,
Roland
September 28th, 2010 11:11am
Hi Roland,
based on your pic below, I see 2 subreports. So how it works is, in the first page, u will get all your matrix/tablix before the first subreport. Second page would have the second subreport and the third page will have the third subreport. Isnt that how
you want it?
The page break between the 2 subreports will happen when you put this property in the second subreport.
Cheers,
Jason
P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)
Free Windows Admin Tool Kit Click here and download it now
September 28th, 2010 11:17am
Hi Jason,
yes, that would be exactly what I want. However, it seems like all page breaks within the tablix are ignored. The page break in your example gives me a blank page, followed by all items and subreports in my tablix on one page.
This happens in the Winforms ReportViewer control. When I click on Print Preview (i.e. switching from soft to hard pagination), I get an error: "An error occurred during local report processing. Parameter is not valid." InteractiveSize and PageSize of the
report are the same though.
Thanks again,
Roland
September 28th, 2010 12:00pm
Hmmm, I am not sure whether I have conveyed the message correctly to you, so let me give a try again.
1) In your picture, you have 4 tables with dark blue headers and you need all 4 of them in one page. For this, don't add any page breaks and let it be as it is.
2) Then you have one subreport which you want to see in a different page. For this, make a tablix, and drag and drop this subreport on the first row as showed in my example above. Modify the property so that you add the page break at the start. This will
make sure that the first page break that is applied is before this subreport and hence, this should come in a new page.
3) Add the second subreport in the next row of the same tablix and modify the property for a page break before. This will make sure that this subreport will be rendered in the next page.
Ideally, this should work in SSRS and it worked for me as I have shown in the example above. If you have followed the same steps as shown above, I am not sure whether it is because of VS2010 environment.Cheers,
Jason
P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)
Free Windows Admin Tool Kit Click here and download it now
September 28th, 2010 1:41pm
Hi Jason,
yes, if I add a page break to a whole tablix, then the tablix will actually be on a new page. However, because I need to group my data - including the data in the blue tables -, I have to use the same tablix for all report objects.
I have created a little mockup report for this: http://www.mediafire.com/?f38y7qbf43n1l
The main report, Report1.rdlc, contains a tablix which groups by ForeignKey1 returned by the stored procedure sputest. In the second column of the first row, some text should be displayed (this is supposed to represent my blue table data). In the second
row, a subreport, SubReport1.rdlc, is displayed. This subreport retrieves the data from sputest2, which expects a parameter - that is ForeignKey1 which we are grouping upon. In the third row, another subreport is shown. This subreport retrieves data from sputest3
which again gets the ForeignKey1 as parameter.
The output I would like to see is (only second column of the tablix):
a
1
<page break>
2
<page break, next record>
b
2
<page break>
3
<page break, next record>
c
3
<page break>
4
But unfortunately, the "<page break>" do not occur, only the "<page break, next record>" are executed (as per the setting in the group properties).
I'm not sure whether my files are helpful and whether you have enough time on your hands to deal with this anyway... but if you do.. you'll be my this month's hero :)
Thanks,
Roland
September 28th, 2010 7:18pm
I also tried having the subreports in separate tablixes in the footer of the grouping tablix, and setting the page break for the inner tablixes, but that is ignored as well.
No one any more ideas?
Thanks,
Roland
Free Windows Admin Tool Kit Click here and download it now
September 30th, 2010 10:24am
Hi Jason
I have a report that displays data for various groups.
Now user want me to show a blank page with address only before every group in the report.
Is there any way that we can link a text box to a tablix and it is in the report bodt and not in header.
I know this is possible in header but am not sure about the report body.
I am not even sure if we can use sub report in this case or not.
Thanks
jenny
November 9th, 2010 12:16pm