Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SSRS Expressions

Posted on 2012-03-15
2
Medium Priority
?
449 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.

715 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