Solved

SSRS Expressions

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Introduction Earlier I wrote an article about the new lookup functions (http://www.experts-exchange.com/A_3433.html) that ship with SQL Server 2008 R2.  In this article I’m going to show you another new feature of SSRS 2008 R2, this time in the vis…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now