Solved

Expression in Report Builder 3.0

Posted on 2011-02-21
6
871 Views
Last Modified: 2012-08-13
I need to change a number to a text description in the expression area. Below is a sample of what I tested. I followed the help file suggestion without success.

I have a table that have numbers I need to convert to text for a description - 1 = "Dispatched"  0 = "Open"  2 = "Transferred"  and so on....

 Query Example Expression example
0
Comment
Question by:srodgers45
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 9

Accepted Solution

by:
sureshbabukrish earned 167 total points
ID: 34950580
use the expression
IIF(Fields!STATUS.Value= 1, "Dispatched",(IIF(Fields!STATUS.Value= 0, "Open",IIF(Fields!STATUS.Value= 2, "Transferred",[againIFFfunction or default value])))

IIF( condition, value if true, value if false)

always add the next condition in [value if false] till you have all the conditions in this expression.
0
 
LVL 21

Assisted Solution

by:Jason Yousef, MS
Jason Yousef, MS earned 167 total points
ID: 34951689
IIF constructions in SSRS always evaluate the entire expression,You can use a SWITCH instead, it'll work like a charm.

The Switch function is useful when you have three or more conditions to test.

=SWITCH(
                       
Fields!STATUS.Value = 0, "Open",
Fields!STATUS.Value = 1, "Dispatched",
Fields!STATUS.Value = 1, ""Transferred"

                      )


you can read about all SSRS expressions here

http://msdn.microsoft.com/en-us/library/ms157328.aspx


Hope that helps
Jason
0
 
LVL 27

Assisted Solution

by:planocz
planocz earned 166 total points
ID: 34963349
You can also use Code in your  reprts code tab
Like This

Public Function Stats(ByVal Pd As Integer) as String
  Select Case Pd
            Case 0
              Return "Open"
            Case 1
              Return "Dispatched"
             Case 2
              Return "Transferred"
End Select
        Return Nothing
   End Function

AND in the report textboxes or dcells the code would be....

=Code.Stats(Fields!STATUS.Value)
0
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 

Author Closing Comment

by:srodgers45
ID: 34966947
Thanks for all the solutions
0
 

Author Comment

by:srodgers45
ID: 34976163
I guess I closed this out to soon?  am I missing something?

Error Message Expression
0
 
LVL 21

Expert Comment

by:Jason Yousef, MS
ID: 34976258
could that be the error? e
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by Valentino Vranken. Introduction: The first step of creating a SQL Server Reporting Services (SSRS) report involves setting up a connection to the data source and programming a dataset to retrieve data from that data source.  The data…
A recent question popped up and the discussion heated up regarding updating a COMMENTS (TXT) field in a table using SSRS. http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Q_27475269.html?cid=1572#a37227028 (htt…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question