I store my data in formatted way in my db ,
I want some way to render the text with its format in my report.rdlc
i use visual studio 2008 How to do this :
For example :
if my text like this :
<p>text</p>
It appears the same with tags in my report text box !!. instead of rendering as a paragraph.
when i bind like this :
= Fields.subject
How to fix this problem ?
Edit
After researching this problem a bit more it appears Visual Studio doesn't support Markup as HTML for rdlc
reports until Visual Studio 2010. So if upgrading is an option, then you can do what you want.
Otherwise you could always just strip out the HTML tags like so:
On the Report
menu, click Report Properties...
and select the Code
tab. Enter the following code:
Function StripHTMLTags(ByVal text as String) AS String
Return System.Text.RegularExpressions.Regex.Replace(text, "<(.|\n)*?>", "")
End Function
Now in your cell use the following expression:
=Code.StripHTMLTags(Fields!MyField.Value)
Original answer follows:
Leaving aside that you should separate data from presentation, you can render using HTML tags in Reporting Services, its just not very intuitive to find:
<Expr>
tag is highlighted<Expr>
tag and choose Placeholder Properties...
General
tab, select the HTML- Interpret HTML tags as style
radio buttonOnly a limited number of tags are supported however. This article on MSDN tells your more.
Screenshots:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With