Reporting

The database cache provider stores the rendered pages and resources in database. This is useful in web farm applications where different computers can serve different requests to the same report, so a common storage is necessary to hold the shared resources.

Before using the database cache provider it is necessary to install the shared database. Start the Database Cache Configuration Tool that can be found in the following location:

-InstallDir-\Tools\DatabaseCacheConfigurator.exe

where InstallDir is the installation directory of Telerik Reporting.

Choose the desired target backend from the drop-down list and specify the connection string to the database being created in the text block below. It is recommended that the database specified in the connection string is different from your production database. Click the "Configure" button to configure the database. The Database Cache Configuration Tool can be used to create a new database or reconfigure an existing one, if the database schema has changed from the previous release of Telerik Reporting.

The database cache provider is distributed as a separate assembly and requires .NET Framework 3.5 and above. It utilizes the Open Access ORM internally to access the database (requires reference to Telerik.OpenAccess.35.Extensions.dll). It is necessary to configure the Telerik Reporting Configuration Section first and then use the following XML snippet to configure this provider in application’s configuration file:

CopyXML
<Telerik.Reporting>
  <Cache provider="Database">
    <Providers>
      <Provider name="Database">
        <Parameters>
          <Parameter name="BackendName" value="mssql" />
          <Parameter name="ConnectionString" value="MyConnectionString" />
        </Parameters>
      </Provider>
    </Providers>
  </Cache>
</Telerik.Reporting>

Here the "BackendName" parameter specifies the name of the chosen backend, and the "ConnectionString" specifies the connection string to the database. The connection string can be specified either as a named connection, configured in the "connectionStrings" section of the configuration file, or directly as an inline connection string.

For applications that use the .NET Framework 2.0 the ADO.NET cache provider can be used instead. The following XML snippet demonstrates how to configure this provider:

CopyXML
<Telerik.Reporting>
  <Cache provider="ADO.NET">
    <Providers>
      <Provider name="ADO.NET">
        <Parameters>
          <Parameter name="ProviderName" value="System.Data.SqlClient" />
          <Parameter name="ConnectionString" value="MyConnectionString" />
        </Parameters>
      </Provider>
    </Providers>
  </Cache>
</Telerik.Reporting>

Here the "ProviderName" parameter specifies the ADO.NET provider, and the "ConnectionString" specifies the connection string to the database.

Binding Redirects

In case you use Telerik Open Access ORM version greater than the version available at the time of the Telerik Reporting release, you have to redirect all assemblies required by the Database Cache Provider to their latest versions. To do this, add the following bindingRedirects to your app.config and replace the 2011.3.1129.2 with the exact version of Open Access ORM assemblies:

CopyXML
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Telerik.OpenAccess" culture="neutral" publicKeyToken="7ce17eeaf1d59342"/>
        <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="2011.3.1129.2"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Telerik.OpenAccess.35.Extensions" culture="neutral" publicKeyToken="7ce17eeaf1d59342"/>
        <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="2011.3.1129.2"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

See Also