Keep Group on One Page Using Reporting Services

I created the report as part of a C # application using Reporting Services and I cannot find some of the functionality that I am used to seeing in other environments. I believe MS Access and Crystal reports have the "Keep Together" option so that you can keep a certain grouping of data on one page rather than splitting the information into two pages.

How do I do this using Reporting Services 2005 when my report is displayed locally in a C # application and viewed with a .net report viewer. Basically, I want to keep all records for a specific year on one page. I am using Visual Studio 2008.

The year is one of the columns, and the number of rows in one year is always less than a page. My report only uses one table and has the innermost grouping by year and then another outer grouping by customer name.

Currently I can fit two years of data into a report, however, if the data starts halfway through the first year, I get this:

Example:

Page one: 1/2 of 2004 because the data started halfway through 04

All 2005

First half of 2006

Page 2: Second half of 2006

I would prefer to make all 2006 on the second page.

I am currently using a table for all data in a report. There is a keep together option at the table level, but I need one at the group level. In this case, Group by years.

Any help that can be provided would be much appreciated.

+12


a source to share


6 answers


The problem was that I needed two years on the page, not six months, even if a certain set of records started halfway after a year. It turns out that while there is a Keep Together option at the table level, there is none at the group level. I need this option at the group level. Instead of using a format solution, I changed the underlying SQL for the report. In cases where I only compiled a year and a half of data, I created records for the other part of the year with correct dates, but zeros for all other values. This means that if a page is formatted correctly to hold two years, it will always show two full years, and one year will never be split across two pages. I also thought the answers provided by Mosey and John Sans were good and I voted both of them.



Thanks for the help!

0


a source


  • Insert "List" into the report.
  • In your Tablix Properties, set the Dataset Name property to the name of your dataset.
  • In the design window, right-click the list and choose Row Group> Group Properties.
  • In the Group Properties window, click the Add button under Group Expressions, then select the field you want to group on the page.
  • After that, you can insert a table for your detail data inside a row group.
  • After the report has been rendered, the report will store the data within a group together between page breaks.


+8


a source


Please click on the group you want to save together on one page in the "Group of Groups" section. Once you click on the group you want, in the properties section, set the Save Together option to True . It. This worked for me.

+5


a source


Just add a bit of John's answer. For SSRS 2005, the List and Table objects have a KeepTogether property, which means they will try to keep everything on the same page. I think the best approach is to follow John's advice first.

+3


a source


Okay, you need to first determine the page size of the reports to be large enough to cover the entire data area.

Cm:

http://msdn.microsoft.com/en-us/library/bb677374.aspx

Then you need to add the page breakpoints to the group in your matrix. See below:

http://msdn.microsoft.com/en-us/library/ms156434.aspx

+2


a source


Use the Rectangle element and copy and paste all the controls into it. In the properties of the tke rectangle, check the box to store the content together. Don't include a border unless you need extra lines.

I had several elements outside of the matrix element that I needed for the footer. I only wanted them on the last page, so I couldn't use the standard bottom section. By placing them in a rectangle, I avoid page breaks in the middle of the group.

+1


a source







All Articles