New to Telerik Reporting? Download free 30-day trial

TypeReferences Element Overview

This element was first introduced in the 2024 Q1 (18.0.24.305) Reporting version.

Defines a collection of type references used by the Reporting Engine to resolve the custom types permitted to be used during the design and processing stages. The assemblies used by the types in TypeReferences section are loaded into application domain if the type is successfully resolved, so it's not necessary to declare the assembly also in the AssemblyReferences section.

XML-based configuration file:

<TypeReferences>
    <add />
    <clear />
    <remove />
</TypeReferences>

JSON-based configuration file:

"typeReferences": [
],

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes
  • typeName – mandatory string attribute. Specifies the full name of the type, i.e. namespace and class name.
  • assemblyName – mandatory string attribute. Specifies the name of the assembly that contains the type.
  • publicKeyToken – optional string attribute. Specifies the public key token of the assembly. Can be omitted or can have empty or null value.
Child Elements
  • add - Optional element. Adds an type reference to the collection.
  • clear - Optional element. Removes all references to inherited type names, allowing only the references that are added by the current add element.
  • remove - Optional element. Removes a reference to an inherited type name from the collection.
Parent Elements
  • configuration - Specifies the root element in every configuration file that is used by the common language runtime and the .NET Framework applications.
  • Telerik.Reporting - Configures all settings that Telerik Reporting Engine uses.

Example

The following code example demonstrates how to configure the Reporting Engine to use the MyNamespace.MyClassName type from the MyAssemblyName assembly, which has a public key token with the value my-assembly-public-key-token. If the type is correctly resolvable at runtime, it will be permitted to be used as a source for ObjectDataSource's data retrieval. This configuration element also allows to list custom types that are allowed in the report definition.

XML-based configuration file:

<?xml version="1.0"?>
<configuration>
    <configSections>
        <section name="Telerik.Reporting" type="Telerik.Reporting.Configuration.ReportingConfigurationSection, Telerik.Reporting" allowLocation="true" allowDefinition="Everywhere" />
    </configSections>
    <Telerik.Reporting>
        <TypeReferences>
            <add typeName="MyNamespace.MyClassName" assemblyName="MyAssemblyName" publicKeyToken="my-assembly-public-key-token" />
        </TypeReferences>
    </Telerik.Reporting>
...
</configuration>

JSON-based configuration file:

"telerikReporting": {
    "typeReferences": [
        {
            "typeName": "MyNamespace.MyClassName",
            "assemblyName": "MyAssemblyName",
            "publicKeyToken": "my-assembly-public-key-token"
        }
    ]
}

When adding the Telerik.Reporting section manually, do not forget to register it in configSections element of the configuration file. Failing to do so will result in a ConfigurationErrorsException with the following text: Configuration system failed to initialize.

See Also

In this article