Solved

SSRS Expressions

Posted on 2012-03-15
2
441 Views
Last Modified: 2012-03-15
How would I rewrite this for SSRS?



if {vw_rpt_Truck_Log_Detail.USEMATERIALDESCR} = 1
then Replace ({vw_rpt_Truck_Log_Detail.MATERIALDESCRIPTION},"<BR>",ChrW (13) + ChrW (10) )
else {vw_rpt_Truck_Log_Detail.DESCRIPTION}
0
Comment
Question by:December2000
[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
2 Comments
 
LVL 37

Accepted Solution

by:
ValentinoV earned 500 total points
ID: 37726768
How about this (assuming your dataset fields are called similar to what you've mentioned):

IIF(Fields!USEMATERIALDESCR.Value = 1, Replace(Fields!MATERIALDESCRIPTION.Value, "<BR>", vbCRLF ), Fields!DESCRIPTION.Value)

To add some explanation: char(13) + char(10) comes down to a carriage return and line feed, and SSRS knows the Visual Basic constant vbCRLF which represents exactly that character sequence.

And IIF and Replace, well, given the context I guess they're clear, right?  If not, just let me know and I'll explain!
0
 

Author Closing Comment

by:December2000
ID: 37727117
Thank you!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

623 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