Adding Custom Code to the Reporting Services 2008 R2
Compile the code to generate the TestClass.dll file. To
access the code inside this file we need to place this dll in the default
location of the Report Designer which is \Microsoft Visual Studio
To add a reference to the file inside the report perform the
Report-> Report Properties from the menu.
2. Select the Reference tab from the report property window
a reference to the TestClass.dll by browsing to the location of the default
report designer i.e \Microsoft Visual Studio
4. Add the following code in the expression of the textbox of the tablix.
This code calls the function defined in the assembly reference. Here you don’t need to use the Code keyword to access the function defined in the Custom assembly. You can also define an instance of the class used in the custom assembly but this is optional as you can access the function using the namespace.classname.functioname inside the expression as shown below:-
output should be as follows
For the custom code to be working after deploying the
report you will need to paste the testClass.dll – i.e the dll file in the bin folder
of the reporting services whose default location is
\Program Files\Microsoft SQL
Finally, just click right on the solution and deploy it on the
report server to view it in the production environment.
Pages: 1 2