Referencing external .NET assemblies
You have already seen the way of adding custom code to reports and you may have already experienced the issues with it such as:
- It supports only Vb.NET
- The same function has to be added to each and every report
With this recipe, we can overcome it by making an assembly that contains all required functions and use it with the report rather repeating it in every report.
Getting ready
In order to make an assembly with all required functions, you need to create a .NET class library using one of .NET languages. Yes, it is not limited to Vb.NET. Let's make one using C#.NET language.
Follow these steps for creating a class library:
- Open the Visual Studio and create a C#.NET Class Library project. Name it as
StandardFunctions
. - Create a public class called
Functions
and add a public static method namedGetTextColor
:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks...