Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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

like image 517
Null Head Avatar asked Sep 29 '11 23:09

Null Head


2 Answers

  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.

like image 97
niktrs Avatar answered Sep 28 '22 11:09

niktrs


Select the entire detail row and add this expression to the BorderStyle-Top property:

=IIF((Previous(Fields!ProductionCountry.Value) <> Fields!ProductionCountry.Value)      OR (Previous(Fields!IndustryName.Value) <> Fields!IndustryName.Value)      OR (Previous(Fields!ProductGroup.Value) <> Fields!ProductGroup.Value),      "Solid",     "None") 
like image 27
Chris Latta Avatar answered Sep 28 '22 11:09

Chris Latta