Expressions in Reporting Services
Expressions are very useful feature in building corporate reports. It helps to build report with dynamic data.
In this article we are going to see how we can use URL’s in reports with the dynamic URL variable using report expression.
A large enterprise having a web server and maintaining a list of most valuable customers list and their web links in a table to do a routine check for availability. We have Microsoft SQL Server Database with a table named CustomerURL.
CREATE DATABASE [TestDB]
CREATE TABLE [dbo].[CustomerURL](
[id] [int] IDENTITY(1,1) NOT NULL,
[URL] [varchar](50) NULL
) ON [PRIMARY]
INSERT INTO [TestDB].[dbo].[CustomerURL]
I assume readers are having basing knowledge of creating reports and browse them. I switch to the actual scene.
We should place Table control in the data region.
If you view the report you cannot see the hyper link. It does show you as a normal tabular data. We have to change the properties of the data cell of the table control.
Now, right click on the URL data cell and select Text Box Properties.
In the textbox properties, Select Action and in the right hand side select Go to URL option, select the URL Field in the combo box.
Write expressions in the Expression box. Click the button next to the combo box.
Fill the value http:// and it should look like this = “http://” & Fields!URL.Value. Click OK now. Preview the report
Your will see the report like this. After textbox property setting URL has been changed the internal link value which will be used to open in the web browser (Internet Explorer).
But, we also need to change the display to give more meaning to the report data.
To concatenate “Http://” value with the URL, Go to textbox properties again and then click the button next to the value textbox. Now, fill the value as you did in the Go to URL value.