I am just getting familiar with report services and making a report with Business Intelligence. I think you can do the same with Report Builder 2.0 – if someone would comment I will update the post. I wanted to add a mailto: link with a subject. You are allowed in expressions, to use any .net function you want, but there is a way to do this.
Not every dll is included by default, and what I wanted to use was the System.Web.HttpUtility.UrlEncode() function. Here is the magic that makes it work:link.
In short, if you are a programmer you would normall put an Imports System.HttpUtilty at the top and then use the function with HttpUtility.UrlEncode()
If you do this, the Intellisense (when the code completes the strings for you) will kick in. This is how you know if it is working.
Basic Steps:
- Click menu Report->Report Properties
- what? no report menu? Ok – right mouse click in the area just outside the tablix and choose Report Properties
- Click References on the Left, then Add at the top and the … button to get a list
- Scroll down and include System.Web, click OK, then OK again
- Put a place holder in any cell by R-Click->Create Placeholder
- Click, THEN Right Mouse click on the placeholder and choose Placeholder Properties
- General Tab fill in the name, the text to show (might be an expression of =”my text here” and tooltip
- Action Tab: Choose “Goto URL” and fill the function listed below
- Format your text
- Click OK twice
- Click Build-Build Project_Name to see if it worked
[vb]
="mailto:me@mycompany.com?subject=" & System.Web.HttpUtility.UrlEncode("Topic:" & Fields!Topics_ID.Value & " " & Fields!TopicText.Value).ToString.Replace("+"," ") & "&body=" & System.Web.HttpUtility.UrlEncode("Q: " & Fields!Topics_ID.Value & "." & Fields!Questions_ID.Value & " " & Fields!QuestionText.Value & vbCrLf & vbCrLf).ToString.Replace("+"," ")
[/vb]