AUTHOR: Todor Arabadzhiev
DATE POSTED: October 13, 2017
Problem
Register .Net Framework data provider for Telerik Reports without installing its driver.
Solution
Telerik Reporting allows fetching data from a variety of data sources (details in this help article). The SqlDataSource component would list and work with any ADO.NET provider that is correctly registered on the device.
The usual way of registering .Net Framework data providers is through installing the corresponding driver. Installation would typically add the required information about the data provider in the machine.config file, and store the necessary assemblies in the Global Assembly Cache (GAC). More information on registering .Net Framework data providers could be found in this MSDN article.
If installation and global registration of additional ADO.NET providers are not desired but is required for data feeding Telerik Reports, you could follow the steps below.
As an example, we would configure Npgsql - a .Net Framework Data Provider for Postgresql Server (version 3.2.1.0) to be used in the Standalone designer.
<
runtime
>
assemblyBinding
xmlns
=
"urn:schemas-microsoft-com:asm.v1"
..................
probing
privatePath
"bin"
/>
dependentAssembly
assemblyIdentity
name
"Npgsql"
culture
"neutral"
publicKeyToken
"5d8b90d52f46fda7"
codeBase
version
"3.2.1.0"
href
"FILE://(appFolder)/bin/Npgsql.dll"
</
"Microsoft.Extensions.DependencyInjection.Abstractions"
"adb9793829ddae60"
"1.1.0.0"
"FILE://(appFolder)/bin/Microsoft.Extensions.DependencyInjection.Abstractions.dll"
"Microsoft.Extensions.Logging.Abstractions"
"FILE://(appFolder)/bin/Microsoft.Extensions.Logging.Abstractions.dll"
"Microsoft.Extensions.Logging"
"FILE://(appFolder)/bin/Microsoft.Extensions.Logging.dll"
"System.Runtime.InteropServices.RuntimeInformation"
"b03f5f7f11d50a3a"
"4.0.1.0"
"FILE://(appFolder)/bin/System.Runtime.InteropServices.RuntimeInformation.dll"
"System.Threading.Tasks.Extensions"
"cc7b13ffcd2ddd51"
"4.1.0.0"
"FILE://(appFolder)/bin/System.Threading.Tasks.Extensions.dll"
system.data
DbProviderFactories
add
"Npgsql Data Provider"
invariant
description
".Net Framework Data Provider for Postgresql Server"
type
"Npgsql.NpgsqlFactory, Npgsql, Version=3.2.1.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7"
With this set up the Standalone designer should successfully find the data provider and grant access to the information stored in the corresponding databases.
Registering new data providers in the VS Telerik Report designer would require the same configuration code to be added to the VS .config file (i.e. devenv.exe.config) that could be found in (VS_installation_folder)/Common7/IDE, which would become also the (appFolder).
Resources Buy Try