Solved

SSRS Expressions

Posted on 2012-03-15
2
436 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
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

830 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