Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS Dynamic Borders

I have the following output which is bound to a SSRS table:

ID    Name            Value

1     Assets           100
2     Liabilities      200
3     Expenses         300
4     Loans            400
5     TOTAL           1000

For the last row (TOTAL), which is the grand total of the above rows, and also a part of the result, I want to set the border conditionally as follows:

  • Top border: Dotted
  • Bottom border: Double-dashed

The last row in the report must look something like this:

----------------
TOTAL   1000
================

Appreciate your inputs.

like image 495
user3261909 Avatar asked May 08 '14 06:05

user3261909


People also ask

How to add Borders in SSRS report?

select the text box, go to Text box Properties -> Border -> Outline -> OK. You can go to the header & footer panel & right click to add border over them separately.

How to insert border for report?

Right-click in the header outside any items in the header, and click Header Properties. On the Border tab, add a left, top, and right border with the style you want. If your report doesn't have headers, you can place borders around just the report body, or you can add headers from the Insert tab.

How do you draw a line in SSRS?

You can make it by clicking on your right tablix and in properties, expand border style and select Solid for Right. You can select left tablix and again, in properties, expand border style and select Solid for Right. You can put both tablixs side-be-side. Then you will have that vertical line you need.


1 Answers

Unfortunately, SSRS does not have a double-dashed option, but you can use conditional formatting on the textbox to control the border.

With your data:

enter image description here

I have a simple table:

enter image description here

For the detail row, I have set the Top and Bottom border style to be expression-based, based on the value of Name:

enter image description here

Top:

=IIf(Fields!Name.Value = "TOTAL", "Dashed", "None")

Bottom:

=IIf(Fields!Name.Value = "TOTAL", "Double", "None")

This gives (very close to) the desired result:

enter image description here

However, be aware that you might run into a few issues, as identified in this MSDN thread:

Double Line border turn to be single in Reporting Service

I had to make sure the Bottom border was 3pt in width and that there was a table footer row to get it to look correct in Preview. Excel works fine whatever.

like image 79
Ian Preston Avatar answered Nov 11 '22 04:11

Ian Preston