New to Telerik Reporting? Download free 30-day trial

restReportService Element Overview

The restReportService element specifies the configuration settings for the Reporting REST Service. For this element to be respected, the corresponding Reports service implementation should pass a ConfigSectionReportServiceConfiguration instance instead of a ReportServiceConfiguration instance.

For example, initializing the ReportServiceConfiguration for the ReportsControllerBase instance would look like this:

configurationInstance = new ConfigSectionReportServiceConfiguration
{
    HostAppId = "Html5DemoApp",
    ReportSourceResolver = new UriReportSourceResolver("PATH_TO_REPORTS_FOLDER")
        .AddFallbackResolver(new TypeReportSourceResolver());,
};

The initialization block does not have the Storage property set, because it would override the values obtained from the configuration file.

Attributes and Elements

<restReportService> element

Attributes
  • hostAppId – optional string attribute. Specifies a unique constant name among the applications hosting a reports service and reusing the same storage destination. The ID is used as a prefix when composing the storage keys to avoid data overlap between apps. When not set, the report service utilizes the AppDomainSetup.ApplicationName property of the current application domain. In some cases, this default value might not be unique enough.
  • workerCount – optional integer attribute. Specifies the count of the worker threads that render report documents. The default value is equal to the logical processors available on the server machine.
  • clientSessionTimeout – optional integer attribute. Specifies the value in minutes indicating how long a client session will be preserved in the service storage after the last interaction from this client. The value must be greater than zero. The default value is 15 minutes.
  • reportSharingTimeout – optional integer attribute. Specifies the value in minutes indicating how long a rendered report document will be viable for reuse for all clients. The value must be greater than or equal to zero. A zero value will prevent rendered report document reuse by other clients. The client that has rendered the report originally will still reuse it. The default value is zero.
  • exceptionsVerbosity – optional string attribute. Specifies the verbosity level of the exception information returned in the response when an exception occurs during report rendering. The supported values are normal and detailed. When set to normal, the response will contain only the exception message. When set to detailed, the response will contain the exception type and stack trace. The default value is normal.
Child elements
  • reportResolver – specifies the report source resolver implementation that will be used for report resolving from the service.
  • storage – specifies the storage implementation that will be used for internal storage from the report service.
Parent element Telerik.Reporting – specifies the root element of the Telerik Reporting configuration settings. Only a single restReportService child element can be used inside the Telerik.Reporting root element.

<reportResolver> element

Attributes
  • provider
    • file
      • directory - string parameter. Specifies the physical directory where reports are located. Used as path prefix when relative path is passed for resolving.
    • type
Child elements parameters – specifies a collection of parameters for the current provider. Only one parameters child element can be used in the provider parent element.
Parent element restReportService

<storage> element

Attributes
  • provider
    • redis or redis2 if you are using StackExchange.Redis version 2.0 and greater
      • configuration - string parameter. The Redis configuration string.
      • databaseNumber - optional integer parameter. Determines the number of the database that should be used.
    • msSqlServer
      • connectionString - string parameter. The connection string to the backend storage.
      • commandTimeout - optional integer parameter. Determines the CommandTimeout that will be used when executing database commands, in seconds. The default value is 30.
    • file
      • directory - optional string parameter. The directory which will contain the files representing the stored values.
    • database
      • backendName - string parameter. Specifies which database engine should be used.
      • connectionString - string parameter. A connection string that should be used to connect to the cache database.
Child elements parameters – specifies a collection of parameters for the current provider. Only one parameters child element can be used in the provider parent element.
Parent element restReportService

Examples

XML-based configuration file:

<configuration>
…
    <Telerik.Reporting>
        <restReportService hostAppId="Application1" workerCount="4" reportSharingTimeout="10" clientSessionTimeout="10" exceptionsVerbosity="detailed">
            <reportResolver provider="type" />
            <storage provider="file">
                <parameters>
                    <parameter name="directory" value="C:\Temp\RestServiceStorage" />
                </parameters>
            </storage>
            <!--<storage provider="Redis">
                <parameters>
                    <parameter name="configuration" value="localhost:10001" />
                    <parameter name="databaseNumber" value="1" />
                </parameters>
            </storage>-->
            <!--<storage provider="Redis2"> Used for StackExchange.Redis version 2.0+
                <parameters>
                    <parameter name="configuration" value="localhost:10001" />
                    <parameter name="databaseNumber" value="1" />
                </parameters>
            </storage>-->
            <!--<storage provider="MSSQLServer">
                <parameters>
                    <parameter name="connectionString" value="Data Source=(local)\SQLEXPRESS;Initial Catalog=RestServiceStorage;Integrated Security=SSPI" />
                    <parameter name="commandTimeout" value="60" />
                </parameters>
            </storage>-->
        </restReportService>
    </Telerik.Reporting>
…
</configuration>

JSON-based configuration file:

"telerikReporting": {
    "restReportService": {
        "hostAppId": "Application1",
        "workerCount": 4,
        "reportSharingTimeout": 10,
        "clientSessionTimeout": 10,
        "exceptionsVerbosity": "detailed",
        "reportResolver": {
            "provider": "type"
        },
        "storage": {
            "provider": "file",
            "parameters": [
                {
                    "name": "directory",
                    "value": "c:\\temp"
                }
            ]
        }
    },
}

See Also

In this article