Creating 5 Star Rating using Indicators in SSRS 2008 R2

Who is online?  0 guests and 1 members
Home  »  Articles  »  Creating 5 Star Rating using Indicators in SSRS 2008 R2

Creating 5 Star Rating using Indicators in SSRS 2008 R2

change text size: A A A
Published: 1/3/2012 by  aseem.sb  - Views:  [708]  

Recently while browsing in MSDN forum, I was came across of this question. A person wanted to show 5 star rating kind of thing (just like we rate a particular blog in MSDN) in SSRS 2008 R2 using Indicators.

As we all know, Indicators is very nice feature introduced in SSRS 2008 R2 which give a very nice look and feel to any report. Here are the steps how we can create 5 star rating in SSRS 2008 R2.

Here, I am assuming that the field which is used for showing 5 star rating has values between 0-5 and also this can have decimal values like 2.5, 3.5 etc.

I have used following sample SQL Query for this report:

SELECT 'Blog0' Title, 0 Rating
UNION
SELECT 'Blog1' , 0.5
UNION
SELECT 'Blog2', 1
UNION
SELECT 'Blog3', 1.5
UNION
SELECT 'Blog4', 2
UNION
SELECT 'Blog5', 2.5
UNION
SELECT 'Blog6' , 3
UNION
SELECT 'Blog7' , 3.5
UNION
SELECT 'Blog8', 4
UNION
SELECT 'Blog9', 4.5
UNION
SELECT 'Blog10', 5

Steps:

  1. Create Dataset in report using above SQL query.
  2. Drag and drop table control on report from toolbox.
  3. Add Five columns to table to show five star indicators as shown in below image.
  4. Table
  5. Drag and drop indicator into each column of type Ratings (5 Star)
  6. Right Click on each indicator, go to Values and States tab and set following properties:
    1. Value = Filed which hold rating details
    2. States Measurement Unit = Numeric
  7. Now add three Indicator Icons under Indicator State section and set their properties as per below:
    1. First Icon = StarQautersNonFilled (Empty Star), Color = Yellow (You can change it)
    2. Second  Icon = StarQautersTwoFilled (Half Filled Star), Color = Yellow (You can change it)
    3. Third Icon = StarQautersAllFilled (Full filled Star), Color = Yellow (You can change it)
  8. Do above step for each indicator (5 Indicators) in table. Refer below Image
  9. ind
  10. Use below table to set Start value and End value of each icon in each indicator. Based on this value icons will shown:

Indicator

Icon

Start Value

End Value

Indicaor1

1 (Not filled)

0

0

Indicaor1

2 (Half Filled)

0.5

0.5

Indicaor1

3 (Full Filled)

1

5

Indicaor2

1 (Not filled)

0

1

Indicaor2

2 (Half Filled)

1.5

1.5

Indicaor2

3 (Full Filled)

2

5

Indicaor3

1 (Not filled)

0

2

Indicaor3

2 (Half Filled)

2.5

2.5

Indicaor3

3 (Full Filled)

3

5

Indicaor4

1 (Not filled)

0

3

Indicaor4

2 (Half Filled)

3.5

3.5

Indicaor4

3 (Full Filled)

4

5

Indicaor5

1 (Not filled)

0

4

Indicaor5

2 (Half Filled)

4.5

4.5

Indicaor5

3 (Full Filled)

5

 

Run report. You will something like below image

result

Well, this is my first attempt of writting, hope whoever reads it, find it helpful. Your comments are welcome.

idiall and pstaerker like this.
 
4.7
/5
Avg: 4.7/5: (2 votes)

Comments (6)

DustinRyan
DustinRyan said:
Nice work. Very cool.
1/3/2012
 · 
 
by
Nikhildas
Nikhildas said:
Very useful..
2/9/2012
 · 
 
by
jason143
jason143 said:
Nice work Aseem... Actually, I was looking to blog on the same subject, you beat me to it :)
2/9/2012
 · 
 
by
diesel
diesel said:
Very Nice Work.
3/25/2012
 · 
 
by
pkumar3
pkumar3 said:
Excellent. Very Cool
28 days ago
 · 
 
by
upendra478
upendra478 said:
Hi Need an urgent help pl. I have a sharepoint site having a excel with Data and Chart. I want to create same through SSRS. I have to make that excel as a datasource and then want a Dataset. but it is giving error that "in text\html but expecting text\xml". Thanks for any reply...
yesterday
 · 
 
by

Most Recent Articles