Showing posts with label ssrs. Show all posts
Showing posts with label ssrs. Show all posts

Sunday, February 19, 2012

Column Header Color

Is there a way in SSRS to conditionally set the color of a column?

I want to do something like:

=IFF(some condition, Color(Fields!Date, "Green"), Color(Fields!Date, "Red"))

Yes you go into the Color property of the text box in the Detail row of the table and set the color to an <expression..> then in the dialog that comes up enter somthing like this...

=iif(Fields!Name.Value = "Smith", "Green", "Red")

if the name = smith make the color green other wise make it red

the key point being that you go to the property and set the property equal to an expression.

if you need more value/color options you can put in a little code in the report that you can reference from the expression.

1. right click in the little box at the top left of the report (intersection of the vertical and horizontal rulers) in the designer and choose properties.

2. select the code tab

3. type in some VB code

ex.

Public Function GetColor(ByVal sname as String) as String
IF sname = "Smith" Then
Return "Blue"
End IF
IF sname = "Jones" Then
Return "Black"
End IF
IF sname = "Woods" Then
Return "Red"
End IF
End Function

4. set the color or background property to =code.GetColor(Fields!Name.Value)

================= off topic FYI

here is another example of a little code for the report that can be used in an expression

this is used in a calulated field in a dataset =Code.GetBox(Fields!Percentile.Value,Fields!Importance.Value)


Public Function GetBox(ByVal PercentImp As Integer, ByVal Important As Integer) As Integer

Select Case Important
Case 1
Select Case PercentImp
Case 0 To 39
GetBox = 1
Case 40 To 75
GetBox = 2
Case Is > 75
GetBox = 3
End Select

Case 2
Select Case PercentImp
Case 0 To 39
GetBox = 4
Case 40 To 75
GetBox = 5
Case Is > 75
GetBox = 6
End Select
Case 3
Select Case PercentImp
Case 0 To 39
GetBox = 7
Case 40 To 75
GetBox = 8
Case Is > 75
GetBox = 9
End Select

End Select

End Function

|||You've made my day. Totally sweet. Thank you!!!

Column Header Color

Is there a way in SSRS to conditionally set the color of a column?

I want to do something like:

=IFF(some condition, Color(Fields!Date, "Green"), Color(Fields!Date, "Red"))

Yes you go into the Color property of the text box in the Detail row of the table and set the color to an <expression..> then in the dialog that comes up enter somthing like this...

=iif(Fields!Name.Value = "Smith", "Green", "Red")

if the name = smith make the color green other wise make it red

the key point being that you go to the property and set the property equal to an expression.

if you need more value/color options you can put in a little code in the report that you can reference from the expression.

1. right click in the little box at the top left of the report (intersection of the vertical and horizontal rulers) in the designer and choose properties.

2. select the code tab

3. type in some VB code

ex.

Public Function GetColor(ByVal sname as String) as String
IF sname = "Smith" Then
Return "Blue"
End IF
IF sname = "Jones" Then
Return "Black"
End IF
IF sname = "Woods" Then
Return "Red"
End IF
End Function

4. set the color or background property to =code.GetColor(Fields!Name.Value)

================= off topic FYI

here is another example of a little code for the report that can be used in an expression

this is used in a calulated field in a dataset =Code.GetBox(Fields!Percentile.Value,Fields!Importance.Value)


Public Function GetBox(ByVal PercentImp As Integer, ByVal Important As Integer) As Integer

Select Case Important
Case 1
Select Case PercentImp
Case 0 To 39
GetBox = 1
Case 40 To 75
GetBox = 2
Case Is > 75
GetBox = 3
End Select

Case 2
Select Case PercentImp
Case 0 To 39
GetBox = 4
Case 40 To 75
GetBox = 5
Case Is > 75
GetBox = 6
End Select
Case 3
Select Case PercentImp
Case 0 To 39
GetBox = 7
Case 40 To 75
GetBox = 8
Case Is > 75
GetBox = 9
End Select

End Select

End Function

|||You've made my day. Totally sweet. Thank you!!!

Thursday, February 16, 2012

Column Chart Bar Borders

Can I add borders to my bars in the column chart? My bars don't appear to have any border, and I can't see a place to set one. I am using SSRS Express.

Thanks!

Michael

1)Double click the bar chart
2)Double click the chart value in the "Drop data fields here"
3)Select the Appearance tab
4)Click on the Series Style at the bottom of the dialog box
5)Choose your style and your color for "Border and Line"

6)Click OK, Click OK

|||

Ah, so much better. Thanks! I knew I had seen the option before, but couldn't find it. I HAD right clicked on the drop data fields items for the other two axes, but not that VALUE axis. Grrr... Thanks for the help!

Michael

Sunday, February 12, 2012

Collect SSRS/SSAS schema (metadata)

Hi all,

I would like to collect metadata from cubes&reports automatically from servers SSAS and SSRS. Metadata include name, description, dimensions, members, permissions, etc. Then I store it into a table to be searchable.

I am searching the best solution for this.
Maybe it would be a SQL stored procedure.
Do anybody has an idea or some piece of help?

thx.
attila

Both servers expose management APIs. The Report Server has web service management APIs while SSAS comes with AMO library.

Collect SSAS / SSRS schema (metadata)

Hi all,

I would like to collect metadata from cubes&reports automatically from servers SSAS and SSRS. Metadata include name, description, dimensions, members, permissions, etc. Then I store it into a table to be searchable.

I am searching the best solution for this.
Maybe it would be a SQL stored procedure.
Has anybody an idea or some piece of help?

thx.
attila

Hey attila,

This can be done using AMO and a little code to store the metadata in some sort of db.

There is some good information here

(really good code examples, too)

Hope that helps a little,
C