How to draw line after every group in SQL Server Reporting Services?

Null Head picture Null Head · Sep 30, 2011 · Viewed 49.3k times · Source

Below is the report I have created. I would like to draw a line after every group as depicted with red line in the image.
Tried meddling with Textbox Properties > Border Style expression. But that would not stay once I close and reopen it.
If I set border for whole group, the line would repeat for every row in group which I dont want.

Any help?

enter image description here

Answer

niktrs picture niktrs · Sep 30, 2011
  1. Click on the View tab in Microsoft SQL Server Report Builder.
  2. Ensure the Properties check box is checked so that the Properties window is shown.
  3. For the ProductionCountry select the entire group row. The properties should show for the row.
  4. In the properties dig down to Border->BorderStyle->Top. The value will more than likely be blank.
  5. In the Top field, enter the expression below for the top border.

Top field value:

=IIF(Fields!ProductionCountry.Value = Previous(Fields!ProductionCountry.Value) OR Fields!ProductionCountry.Value = First(Fields!ProductionCountry.Value, "mydataset"),"None","Solid")

Change mydataset value above to match the dataset name of your report.

Note:

If current row belongs to the same group as the previous row OR current group row is the first of the dataset, set border to none, set border to solid.