New to Telerik Reporting? Download free 30-day trial

Reporting REST service with RedisStorage returns error 500 to requests.

Environment

Product Progress® Telerik® Reporting
Storage Redis

Description

Reporting REST service with RedisStorage returns error 500. As a result on cache entries are recorded in the Redis instance.

Solution 

Test connecting to the Redis instance in code to verify that the connection string is correct and that the Redis instance is running and accessible.

The Reporting REST service's configuration in code would look like:

public class ReportsController : ReportsControllerBase
    {
        static ReportServiceConfiguration configurationInstance;

        static ReportsController()
        {
            //This is the folder that contains the XML (trdx/trdp) report definitions
            //In this case this is the Reports folder
            var appPath = HttpContext.Current.Server.MapPath("~/");
            var reportsPath = Path.Combine(appPath, "Reports");

            //Add resolver for trdx report definitions,
            //then add resolver for class report definitions as fallback resolver;
            //finally create the resolver and use it in the ReportServiceConfiguration instance.
            var resolver = new ReportFileResolver(reportsPath).AddFallbackResolver(new ReportTypeResolver());

            //Setup the ReportServiceConfiguration      
            configurationInstance = new ReportServiceConfiguration
            {
                HostAppId = "Html5App",
                Storage = new RedisStorage(ConnectionMultiplexer.Connect("RedisConnectionStringHERE")),           
                ReportResolver = resolver,
                // ReportSharingTimeout = 0,
                // ClientSessionTimeout = 15,
            };
        }

        public ReportsController()
        {
            //Initialize the service configuration
            this.ReportServiceConfiguration = configurationInstance;
        }  
    }
Public Class ReportsController
    Inherits ReportsControllerBase
    Shared configurationInstance As ReportServiceConfiguration

    Shared Sub New()
        'This is the folder that contains the XML (trdx/trdp) report definitions
        'In this case this is the Reports folder
        Dim appPath = HttpContext.Current.Server.MapPath("~/")
        Dim reportsPath = Path.Combine(appPath, "Reports")

        'Add resolver for trdx report definitions,
        'then add resolver for class report definitions as fallback resolver;
        'finally create the resolver and use it in the ReportServiceConfiguration instance.
        Dim resolver = New ReportFileResolver(reportsPath).AddFallbackResolver(New ReportTypeResolver())

        'Setup the ReportServiceConfiguration      
            ' ReportSharingTimeout = 0,
            ' ClientSessionTimeout = 15,
        configurationInstance = New ReportServiceConfiguration() With { _
            Key .HostAppId = "Html5App", _
            Key .Storage = New RedisStorage(ConnectionMultiplexer.Connect("RedisConnectionStringHERE")), _
            Key .ReportResolver = resolver _
        }
    End Sub

    Public Sub New()
        'Initialize the service configuration
        Me.ReportServiceConfiguration = configurationInstance
    End Sub
End Class

Notes

The Redis storage requires StackExchange.Redis.StrongName.dll,and Telerik.Reporting.Cache.StackExchangeRedis.dll built against StackExchange.Redis.StrongName.dll v1.0.316.0.
If you use a newer version of StackExchange.Redis.StrongName.dll, you will need a binding redirect for the assembly in the Reporting REST service project's configuration file.

See Also

How to: Use Redis storage.

In this article