skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Use Reports in Applications
    • System Requirements
    • Forums
    • Videos
    • Blogs
    • Submit a Ticket
    • FAQs
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now
Search all

Class ReportsControllerBase

Abstract base controller for exposing Telerik Reporting Services as a WebAPI to client applications. This controller provides RESTful endpoints for report processing operations including client management, document generation, and interactive features. A call to the RegisterRoutes(HttpConfiguration) method must be added to the WebApiConfig.Register method so that the controller actions are accessible from the routing mechanisms of the ASP.Net WebAPI framework. To set up the Telerik Reporting REST service, inherit from this class and configure the ReportServiceConfiguration property.

Inheritance
System.Object
ReportsControllerBase
ReportDesignerControllerBase
Namespace: Telerik.Reporting.Services.WebApi
Assembly: Telerik.Reporting.Services.WebApi.dll

Syntax

[ReportsExceptionFilter]
public abstract class ReportsControllerBase : ApiController

Constructors

ReportsControllerBase()

Initializes a new instance of the ReportsControllerBase class with default settings.

Declaration
protected ReportsControllerBase()
Remarks

Derived classes must configure the ReportServiceConfiguration property to provide proper service functionality. The configuration should be set in the derived class constructor or through dependency injection.

Properties

ReportServiceConfiguration

Gets or sets the configuration settings for the report service.

Declaration
public IReportServiceConfiguration ReportServiceConfiguration { get; set; }
Property Value
IReportServiceConfiguration

An IReportServiceConfiguration instance that defines the service behavior, storage, resolvers, and other settings.

Remarks

This property must be configured when inheriting from ReportsControllerBase to provide essential service functionality. The configuration object should implement IReportServiceConfiguration and be set in the controller's constructor using a static object to preserve configuration between requests, or through dependency injection.

Examples

This example shows how to configure WebAPI service using dependency injection.

  1. Setup method registering the configuration object in a dependency injection container. The example uses the Unity container.
    using System.Web;
    using Telerik.Reporting.Services;
    
    public static class WebApiConfig
    {
        public static void RegisterDependencies(System.Web.Http.HttpConfiguration config)
        {
            var container = new Unity.UnityContainer();
    
            container.RegisterInstance(
                typeof(Telerik.Reporting.Services.IReportServiceConfiguration),
                null,
                CreateReportServiceConfiguration());
    
            config.DependencyResolver = new UnityResolver(container);
        }
    
        static IReportServiceConfiguration CreateReportServiceConfiguration()
        {
            var resolver = new UriReportSourceResolver(HttpContext.Current.Server.MapPath("~/Reports"))
                .AddFallbackResolver(new TypeReportSourceResolver());
    
            return new ReportServiceConfiguration
            {
                HostAppId = "Application1",
                ReportSourceResolver = resolver,
                Storage = new Telerik.Reporting.Cache.File.FileStorage(),
                // Storage = new Telerik.Reporting.Cache.StackExchangeRedis.RedisStorage(StackExchange.Redis.ConnectionMultiplexer.Connect("localhost:10001")),
                // Storage = new Telerik.Reporting.Cache.MsSqlServerStorage(@"Data Source=(local)\SQLEXPRESS;Initial Catalog=RSStorage;Integrated Security=SSPI"),
            };
        }
    }
    
    Public NotInheritable Class WebApiConfig
        Private Sub New()
        End Sub
        Public Shared Sub RegisterDependencies(config As System.Web.Http.HttpConfiguration)
            Dim container = New Unity.UnityContainer()
    
            container.RegisterInstance(
                GetType(IReportServiceConfiguration),
                Nothing,
                CreateReportServiceConfiguration())
    
            config.DependencyResolver = New UnityResolver(container)
        End Sub
    
        Private Shared Function CreateReportServiceConfiguration() As IReportServiceConfiguration
            Dim resolver = New UriReportSourceResolver(
                            HttpContext.Current.Server.MapPath("~/Reports")) _
                            .AddFallbackResolver(New TypeReportSourceResolver())
    
            Dim reportServiceConfiguration As New ReportServiceConfiguration()
            reportServiceConfiguration.HostAppId = "Application1"
            reportServiceConfiguration.ReportSourceResolver = resolver
            reportServiceConfiguration.Storage = New Telerik.Reporting.Cache.File.FileStorage()
            'reportServiceConfiguration.Storage = New Telerik.Reporting.Cache.StackExchangeRedis.RedisStorage(StackExchange.Redis.ConnectionMultiplexer.Connect("localhost:10001"))
            'reportServiceConfiguration.Storage = New Telerik.Reporting.Cache.MSSqlServerStorage("Data Source=(local)\SQLEXPRESS;Initial Catalog=RSStorage;Integrated Security=SSPI")
    
            Return reportServiceConfiguration
        End Function
    End Class
    
    Example based on the article Dependency Injection in ASP.NET Web API 2
  2. ReportsController implementation
    public class ReportsController : Telerik.Reporting.Services.WebApi.ReportsControllerBase
    {
        public ReportsController(ReportServiceConfiguration configuration)
        {
            this.ReportServiceConfiguration = configuration;
        }
    }
    
    Public Class ReportsController
        Inherits WebApi.ReportsControllerBase
        Public Sub New(configuration As ReportServiceConfiguration)
            Me.ReportServiceConfiguration = configuration
        End Sub
    End Class
    
  3. Invoke the setup in the Application_Start method.
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            WebApiConfig.RegisterDependencies(System.Web.Http.GlobalConfiguration.Configuration);
            //...
        }
    }
    
    Public Class MvcApplication
        Inherits System.Web.HttpApplication
        Protected Sub Application_Start()
            WebApiConfig.RegisterDependencies(System.Web.Http.GlobalConfiguration.Configuration)
            '...
        End Sub
    End Class
    
See Also
IReportServiceConfiguration
ReportServiceConfiguration

Methods

AddTelerikReporting()

Creates a default ReportServiceConfiguration using the application domain settings.

Declaration
protected static ReportServiceConfiguration AddTelerikReporting()
Returns
ReportServiceConfiguration

A ReportServiceConfiguration instance configured with default settings for the current application domain.

Remarks

This method creates a configuration using the current application domain's friendly name as the host application ID and the base directory as the reports path. Uses file storage and URI report source resolver with fallback to type resolver for report resolution.

AddTelerikReporting(String, String)

Creates a ReportServiceConfiguration with custom host application ID and reports path.

Declaration
protected static ReportServiceConfiguration AddTelerikReporting(string hostAppId, string reportsPath)
Parameters
System.String hostAppId

The unique identifier for the host application, used for resource management and caching.

System.String reportsPath

The file system path where report files are located.

Returns
ReportServiceConfiguration

A ReportServiceConfiguration instance configured with the specified parameters and default storage settings.

Remarks

This overload uses URI report source resolver with type resolver fallback and file-based storage for caching. Ideal for applications that need to specify custom report locations while using default storage mechanisms.

AddTelerikReporting(String, IStorage, IReportSourceResolver)

Creates a ReportServiceConfiguration with custom storage and report resolution components.

Declaration
public static ReportServiceConfiguration AddTelerikReporting(string hostAppId, IStorage storage, IReportSourceResolver reportSourceResolver)
Parameters
System.String hostAppId

The unique identifier for the host application, used for resource management and caching.

IStorage storage

The storage implementation for caching rendered documents and report data.

IReportSourceResolver reportSourceResolver

The resolver responsible for locating and loading report definitions.

Returns
ReportServiceConfiguration

A ReportServiceConfiguration instance configured with the specified storage and resolver components.

Remarks

This overload allows full control over storage and report resolution mechanisms while using default AI integration settings. Use this method when you need custom storage implementations or specialized report resolution logic.

AddTelerikReporting(String, IStorage, IReportSourceResolver, Func<IClient>)

Creates a ReportServiceConfiguration with AI integration capabilities.

Declaration
public static ReportServiceConfiguration AddTelerikReporting(string hostAppId, IStorage storage, IReportSourceResolver reportSourceResolver, Func<IClient> aiClientFactory)
Parameters
System.String hostAppId

The unique identifier for the host application, used for resource management and caching.

IStorage storage

The storage implementation for caching rendered documents and report data.

IReportSourceResolver reportSourceResolver

The resolver responsible for locating and loading report definitions.

System.Func<IClient> aiClientFactory

A factory function that creates AI client instances for report enhancement and analysis features.

Returns
ReportServiceConfiguration

A ReportServiceConfiguration instance configured with AI integration support.

Remarks

This overload enables AI-powered features such as intelligent report analysis, content suggestions, and automated insights. The AI client factory should return configured instances that can communicate with your chosen AI service provider.

AddTelerikReporting(String, IStorage, IReportSourceResolver, Func<IClient>, IReportDocumentResolver, ICompressor, String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>)

Creates a comprehensive ReportServiceConfiguration with full customization options.

Declaration
public static ReportServiceConfiguration AddTelerikReporting(string hostAppId, IStorage storage, IReportSourceResolver reportSourceResolver, Func<IClient> aiClientFactory, IReportDocumentResolver reportDocumentResolver, ICompressor cacheCompressor = null, string exceptionsVerbosity = null, int? clientSessionTimeout = default(int? ), int? reportSharingTimeout = default(int? ), int? workerCount = default(int? ))
Parameters
System.String hostAppId

The unique identifier for the host application, used for resource management and caching.

IStorage storage

The storage implementation for caching rendered documents and report data.

IReportSourceResolver reportSourceResolver

The resolver responsible for locating and loading report definitions.

System.Func<IClient> aiClientFactory

A factory function that creates AI client instances for report enhancement and analysis features.

IReportDocumentResolver reportDocumentResolver

The resolver for handling report document operations and transformations.

ICompressor cacheCompressor

The compression algorithm for optimizing cached data storage. Defaults to GZip compression.

System.String exceptionsVerbosity

The level of detail included in exception messages returned to clients.

System.Nullable<System.Int32> clientSessionTimeout

The timeout period in seconds for client sessions. Uses default if not specified.

System.Nullable<System.Int32> reportSharingTimeout

The timeout period in seconds for report sharing operations. Uses default if not specified.

System.Nullable<System.Int32> workerCount

The number of worker threads for parallel report processing. Uses default if not specified.

Returns
ReportServiceConfiguration

A fully configured ReportServiceConfiguration instance with all specified customizations applied.

Remarks

This is the most comprehensive configuration method, allowing fine-grained control over all aspects of the reporting service. Use this method when you need to customize performance settings, error handling, compression, or document processing behavior. All optional parameters will use system defaults if not provided, ensuring reliable operation with minimal configuration.

CreateAIThread(String, String, ClientReportSource)

Creates an AI conversation thread for GenAI-powered insights based on the rendered document content.

Declaration
public virtual HttpResponseMessage CreateAIThread(string clientID, string instanceID, ClientReportSource reportSource)
Parameters
System.String clientID

The clientID of the session the AI thread is started in

System.String instanceID

The report instance used for the AI thread

ClientReportSource reportSource

The report source used by the client (viewer). May be used by end-users for more control over AI functionality per specific report (custom prompts, consent, etc.).

Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing the AI thread information including thread ID and available prompt templates.

Remarks

This method initializes an AI conversation context based on the report content and metadata. The thread can be used for subsequent AI queries to gain insights about the report data. Requires AI client configuration to be properly set up in the service configuration.

CreateCache()

Creates an ICache implementation instance that will be used for internal storage from the service.

Declaration
[Obsolete("CreateCache method is now obsolete. Please provide service setup using the Telerik.Reporting.Services.WebApi.ReportsControllerBase.ReportServiceConfiguration property.")]
protected virtual ICache CreateCache()
Returns
ICache

An instance of cache that will be used from the controller in order to preserve its cache/state.

Remarks

Override this method in order to create the cache instance. May be one of the built-in caching implementations or a custom implementation. To use one of the built-in caching implementations use the CacheFactory class.

See Also
CacheFactory

CreateDocument(String, String, CreateDocumentArgs)

Creates a new document in the specified format from a report instance.

Declaration
public virtual HttpResponseMessage CreateDocument(string clientID, string instanceID, CreateDocumentArgs args)
Parameters
System.String clientID

The unique identifier of the client session.

System.String instanceID

The unique identifier of the report instance to render.

CreateDocumentArgs args

The document creation arguments specifying format, settings, and caching options.

Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing the document ID that can be used to retrieve the generated document.

Remarks

This method initiates document generation in the specified format using the provided format-specific settings. Document creation may be asynchronous; use the returned document ID to check status and retrieve the final document. Supports caching and interactive document features through the provided arguments.

CreateErrorResponse(HttpStatusCode, String)

Creates an HTTP error response with a structured error message for client consumption.

Declaration
protected HttpResponseMessage CreateErrorResponse(HttpStatusCode statusCode, string message)
Parameters
System.Net.HttpStatusCode statusCode

The HTTP status code to return to the client.

System.String message

The error message describing the problem encountered.

Returns
System.Net.Http.HttpResponseMessage

An System.Net.Http.HttpResponseMessage containing the error information in a structured format.

Remarks

This method creates standardized error responses that client applications can easily parse and handle. The error message is wrapped in a consistent JSON structure for uniform error handling.

CreateInstance(String, ClientReportSource)

Creates a new report instance within a client session for subsequent document generation operations.

Declaration
public virtual HttpResponseMessage CreateInstance(string clientID, ClientReportSource reportSource)
Parameters
System.String clientID

The unique identifier of the client session.

ClientReportSource reportSource

The report source configuration and parameter values that define the report instance.

Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing the unique instance ID that can be used to generate documents from this report instance.

Remarks

A report instance represents a specific report with resolved parameters and data sources. The instance ID is required for all document generation operations and remains valid until the client session expires or the instance is explicitly deleted.

CreateMailMessage(SendDocumentArgs, DocumentData)

Creates and configures a mail message with the specified document attached for email delivery.

Declaration
protected virtual MailMessage CreateMailMessage(SendDocumentArgs args, DocumentData result)
Parameters
SendDocumentArgs args

The email message configuration including recipients, subject, body, and sender information.

DocumentData result

The document data containing the binary content, name, extension, and MIME type to attach.

Returns
System.Net.Mail.MailMessage

A configured System.Net.Mail.MailMessage instance ready for sending with the document attached.

Remarks

This method creates a complete mail message with proper headers, recipients, and the document as an attachment. The document is attached with the correct filename and MIME type for proper client handling. Override this method to customize mail message creation or add additional attachments.

CreateReportResolver()

Creates an IReportResolver implementation instance that will be used for report resolving from the service.

Declaration
[Obsolete("CreateReportResolver method is now obsolete. Please provide service setup using the Telerik.Reporting.Services.WebApi.ReportsControllerBase.ReportServiceConfiguration property.")]
protected virtual IReportResolver CreateReportResolver()
Returns
IReportResolver

IReportResolver instance.

Remarks

Override this method in order to create the report resolver instance. May be one of the built-in report resolvers or a custom implementation resolver. Built-in resolvers may be chained.

See Also
IReportResolver
ReportFileResolver
ReportTypeResolver

CreateStorage()

Creates an IStorage implementation instance that will be used for internal storage from the service.

Declaration
[Obsolete("CreateStorage method is now obsolete. Please provide service setup using the Telerik.Reporting.Services.WebApi.ReportsControllerBase.ReportServiceConfiguration property.")]
protected virtual IStorage CreateStorage()
Returns
IStorage

An instance of storage that will be used from the controller in order to preserve its cache/state.

Remarks

Override this method in order to create the storage instance. May be one of the built-in storage implementations or a custom implementation. MsSqlServerStorage RedisStorage

See Also
CacheFactory

DeleteDocument(String, String, String)

Deletes a specific document from a client session and releases associated resources.

Declaration
public virtual HttpResponseMessage DeleteDocument(string clientID, string instanceID, string documentID)
Parameters
System.String clientID

The unique identifier of the client session containing the document.

System.String instanceID

The unique identifier of the report instance that generated the document.

System.String documentID

The unique identifier of the document to delete.

Returns
System.Net.Http.HttpResponseMessage

An HTTP response with no content (204) indicating successful deletion.

Remarks

This operation permanently removes the document from the client session cache. Use this method to free up server resources when the document is no longer needed.

DeleteInstance(String, String)

Deletes a report instance from a client session and releases associated resources.

Declaration
public virtual HttpResponseMessage DeleteInstance(string clientID, string instanceID)
Parameters
System.String clientID

The unique identifier of the client session containing the instance.

System.String instanceID

The unique identifier of the report instance to delete.

Returns
System.Net.Http.HttpResponseMessage

An HTTP response with no content (204) indicating successful deletion.

Remarks

This operation permanently removes the report instance and all associated documents from the client session. Use this method to free up server resources when the report instance is no longer needed.

ExecuteInteractiveAction(String, String, String, String)

Executes an interactive action on a document such as drill-down, sorting, parameter changes, or navigation.

Declaration
public virtual HttpResponseMessage ExecuteInteractiveAction(string clientID, string instanceID, string documentID, string actionID)
Parameters
System.String clientID

The unique identifier of the client session containing the document.

System.String instanceID

The unique identifier of the report instance.

System.String documentID

The unique identifier of the document to apply the action to.

System.String actionID

The unique identifier of the interactive action to execute.

Returns
System.Net.Http.HttpResponseMessage

An HTTP response with HTTP 200 (OK) indicating the action was successfully executed.

Remarks

Interactive actions modify the document state and may trigger regeneration of affected pages or sections. Common actions include drill-down navigation, column sorting, parameter value changes, and bookmark navigation. After executing an action, clients should refresh affected pages to see the updated content.

GetAIResponse(String, String, String, String, AIQueryArgs)

Submits a question to the AI model and receives insights based on the rendered report data and metadata.

Declaration
public virtual Task<HttpResponseMessage> GetAIResponse(string clientID, string instanceID, string documentID, string threadID, AIQueryArgs args)
Parameters
System.String clientID

The unique identifier of the client session containing the AI thread.

System.String instanceID

The unique identifier of the report instance being analyzed.

System.String documentID

The unique identifier of the document from which report metadata is extracted.

System.String threadID

The unique identifier of the AI conversation thread.

AIQueryArgs args

The query arguments containing the question and any additional context.

Returns
System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

An HTTP response containing the AI-generated response and insights about the report data.

Remarks

This method processes natural language queries about the report content using AI capabilities. The AI model analyzes the report data, structure, and metadata to provide relevant insights and answers. Requires proper AI client configuration and an active AI thread context.

GetClientsSessionTimeoutSeconds()

Gets the configured client session timeout value in seconds.

Declaration
public virtual HttpResponseMessage GetClientsSessionTimeoutSeconds()
Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing the client session timeout duration in seconds.

Remarks

This value represents how long client sessions remain active without activity before automatically expiring. The timeout is configured through ClientSessionTimeout.

GetConfiguration()

Gets comprehensive backend configuration settings and capabilities information.

Declaration
public virtual HttpResponseMessage GetConfiguration()
Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing a ConfigurationInfo instance with version, features, and configuration details.

Remarks

This method provides detailed information about the backend configuration including version, available features, AI capabilities, and service settings. Use this endpoint instead of the deprecated GetVersion method for comprehensive backend information.

GetDocument(String, String, String)

Gets the complete document content for single-stream document formats such as PDF, Excel, or Word.

Declaration
public virtual HttpResponseMessage GetDocument(string clientID, string instanceID, string documentID)
Parameters
System.String clientID

The unique identifier of the client session containing the document.

System.String instanceID

The unique identifier of the report instance that generated the document.

System.String documentID

The unique identifier of the document to retrieve.

Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing the document as a binary stream with appropriate content type and disposition headers.

Remarks

This method is used for document formats that consist of a single file (PDF, XLSX, DOCX, etc.). For multi-stream formats like HTML5, use GetPage and GetResource methods instead. The response includes proper MIME type and optional content disposition headers for download.

GetDocumentFormats()

Gets the list of available document rendering formats supported by the report engine.

Declaration
public virtual HttpResponseMessage GetDocumentFormats()
Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing the list of supported rendering extensions and their capabilities.

Remarks

This endpoint provides information about all available output formats such as PDF, Excel, Word, CSV, HTML, and others. The response includes format names, MIME types, and capabilities for each rendering extension.

GetDocumentInfo(String, String, String)

Gets information and metadata about a specific document including its processing status and capabilities.

Declaration
public virtual HttpResponseMessage GetDocumentInfo(string clientID, string instanceID, string documentID)
Parameters
System.String clientID

The unique identifier of the client session containing the document.

System.String instanceID

The unique identifier of the report instance that generated the document.

System.String documentID

The unique identifier of the document.

Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing document information including ready status, page count, navigation features, and available rendering extensions.

Remarks

This method provides comprehensive information about the document state and capabilities. Returns HTTP 200 (OK) when the document is ready, or HTTP 202 (Accepted) when still processing.

GetPage(String, String, String, Int32)

Gets a specific page from a document in multi-stream format such as HTML5 or interactive formats.

Declaration
public virtual HttpResponseMessage GetPage(string clientID, string instanceID, string documentID, int pageNumber)
Parameters
System.String clientID

The unique identifier of the client session containing the document.

System.String instanceID

The unique identifier of the report instance that generated the document.

System.String documentID

The unique identifier of the document.

System.Int32 pageNumber

The page number to retrieve (1-based indexing).

Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing the page content, styles, actions, and layout information. Returns HTTP 200 (OK) when the page is ready, or HTTP 202 (Accepted) when still processing.

Remarks

This method is used for document formats that support page-by-page rendering, particularly HTML5 format. The response includes encoded page content, associated styles, interactive actions, and layout metadata. For single-stream formats like PDF, use the GetDocument method instead.

GetPageSettings(String, ClientReportSource)

Gets the page layout settings and metadata for a specific report source.

Declaration
public virtual HttpResponseMessage GetPageSettings(string clientID, ClientReportSource reportSource)
Parameters
System.String clientID

The unique identifier of the client session.

ClientReportSource reportSource

The report source configuration specifying which report to analyze.

Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing page layout information including dimensions, margins, and orientation settings.

Remarks

This method analyzes the report and returns layout information that can be used by client applications for print preview or layout planning. The page settings include paper size, orientation, margins, and other layout-related properties.

GetParameters(String, ClientReportSource)

Gets the report parameters and their metadata for a specific report source within a client session.

Declaration
public virtual HttpResponseMessage GetParameters(string clientID, ClientReportSource reportSource)
Parameters
System.String clientID

The unique identifier of the client session.

ClientReportSource reportSource

The report source configuration specifying which report to analyze.

Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing the report parameters with their types, default values, and validation rules.

Remarks

This method analyzes the specified report and returns metadata about its parameters including data types, allowed values, dependencies, and default values. The parameter information is used by client applications to build parameter input interfaces.

GetReportInstanceKey(String)

Resolves an instance ID to its corresponding report instance key for internal engine operations.

Declaration
protected ReportInstanceKey GetReportInstanceKey(string instanceID)
Parameters
System.String instanceID

The unique identifier of the report instance to resolve.

Returns
ReportInstanceKey

A ReportInstanceKey if the instance exists and is valid; otherwise, null.

Remarks

This utility method provides access to the internal report instance key structure used by the reporting engine. Primarily intended for advanced scenarios and internal use. Most applications should not need to use this method directly.

GetResource(String, String)

Gets embedded report viewer resources such as scripts, stylesheets, images, and other static assets.

Declaration
public virtual HttpResponseMessage GetResource(string folder, string resourceName)
Parameters
System.String folder

The folder path within the resource hierarchy where the resource is located.

System.String resourceName

The name of the specific resource file to retrieve.

Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing the requested resource with appropriate content type and caching headers. Returns HTTP 404 (Not Found) if the resource doesn't exist.

Remarks

This method serves static resources required by the report viewer client components. Resources are served with appropriate caching headers to optimize client performance. Common resource types include JavaScript files, CSS stylesheets, images, and fonts.

GetResource(String, String, String, String)

Gets a specific resource (image, chart, etc.) that is part of a multi-stream document format.

Declaration
public virtual HttpResponseMessage GetResource(string clientID, string instanceID, string documentID, string resourceID)
Parameters
System.String clientID

The unique identifier of the client session containing the document.

System.String instanceID

The unique identifier of the report instance that generated the document.

System.String documentID

The unique identifier of the document.

System.String resourceID

The unique identifier of the specific resource to retrieve.

Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing the resource as a binary stream with appropriate content type headers.

Remarks

This method retrieves document resources such as images, charts, or other embedded content that are part of multi-stream formats. Resources are typically referenced from HTML5 pages and are served with appropriate MIME types. Each resource has a unique ID that is referenced in the page content.

GetSearchResults(String, String, String, SearchArgs)

Performs a text search within a document and returns matching results with location information.

Declaration
public virtual HttpResponseMessage GetSearchResults(string clientID, string instanceID, string documentID, SearchArgs args)
Parameters
System.String clientID

The unique identifier of the client session containing the document.

System.String instanceID

The unique identifier of the report instance.

System.String documentID

The unique identifier of the document to search within.

SearchArgs args

The search criteria including search text, options, and filtering parameters.

Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing search results with location information, or HTTP 204 (No Content) if no matches found.

Remarks

This method searches through the document content and returns matches with page numbers and positional information. Search results can be used by client applications to implement find/highlight functionality. Supports various search options such as case sensitivity, whole word matching, and regular expressions.

GetUserIdentity()

Override this method to substitute the default UserIdentity retrieval logic, which uses System.Web.HttpContext.Current.User.Identity.

Declaration
protected virtual UserIdentity GetUserIdentity()
Returns
UserIdentity

The UserIdentity object instance, that can be later retrieved by Current property or by using expression =UserIdentity.

GetVersion()

Gets the version information of the Telerik Reporting engine and components.

Declaration
[Obsolete("The endpoint 'version' is deprecated. Please use the 'configuration' endpoint instead.")]
public virtual HttpResponseMessage GetVersion()
Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing the version number in string format.

Remarks

This endpoint is deprecated. Use the GetConfiguration endpoint instead for comprehensive backend information. The version information includes the Telerik Reporting assembly version and build details.

KeepClientAlive(String)

Extends the client session lifetime by the configured timeout duration to prevent expiration.

Declaration
public virtual HttpResponseMessage KeepClientAlive(string clientID)
Parameters
System.String clientID

The unique identifier of the client session to keep alive.

Returns
System.Net.Http.HttpResponseMessage

An HTTP response with no content (204) on success, or bad request (400) if the client has already expired.

Remarks

This method resets the client session timeout, extending it by the value specified in ClientSessionTimeout. Call this method periodically from long-running client applications to prevent session expiration.

OnCreateDocument(CreateDocumentEventArgs)

Called before document rendering begins to allow custom processing or modification of rendering parameters.

Declaration
protected virtual void OnCreateDocument(CreateDocumentEventArgs args)
Parameters
CreateDocumentEventArgs args

The event arguments containing information about the document being created, including format and device settings.

Remarks

Override this method to implement custom logic that should execute before document rendering. This can be used for logging, parameter validation, custom device setting injection, or other pre-rendering tasks. The default implementation is empty.

OnGetDocument(GetDocumentEventArgs)

Called after document generation but before sending the response to allow custom processing or modification of document content.

Declaration
protected virtual void OnGetDocument(GetDocumentEventArgs args)
Parameters
GetDocumentEventArgs args

The event arguments containing the document data including content, name, extension, and error information.

Remarks

Override this method to implement custom logic that should execute after document rendering but before client delivery. This can be used for content modification, custom logging, watermarking, or other post-processing tasks. Changes made to the event arguments will affect the content sent to the client. The default implementation is empty.

ProcessDocumentId(String)

Called after a document ID is generated to allow custom processing or logging.

Declaration
protected virtual void ProcessDocumentId(string documentId)
Parameters
System.String documentId

The unique identifier of the newly created document.

Remarks

Override this method in derived classes to implement custom logic that should execute after document creation. This can be used for logging, tracking, or other post-creation processing tasks. The default implementation is empty.

RegisterClient()

Registers a new HTTP service client and creates a session for report processing operations.

Declaration
public virtual HttpResponseMessage RegisterClient()
Returns
System.Net.Http.HttpResponseMessage

An HTTP response containing the unique client ID that should be used for subsequent requests.

Remarks

Each client session maintains its own state including cached data, report instances, and documents. The client ID must be included in all subsequent API calls to maintain session context. Client sessions automatically expire after the configured timeout period.

SendDocument(String, String, String, SendDocumentArgs)

Sends an email message with the specified document attached to the configured recipients.

Declaration
public virtual HttpResponseMessage SendDocument(string clientID, string instanceID, string documentID, SendDocumentArgs args)
Parameters
System.String clientID

The unique identifier of the client session containing the document.

System.String instanceID

The unique identifier of the report instance that generated the document.

System.String documentID

The unique identifier of the document to attach to the email.

SendDocumentArgs args

The email message configuration including recipients, subject, body, and sender information.

Returns
System.Net.Http.HttpResponseMessage

An HTTP response indicating the email sending status. Returns NotImplemented (501) by default unless SendMailMessage is overridden.

Remarks

This method creates a mail message with the document attached and delegates actual sending to the SendMailMessage method. Override the SendMailMessage method in derived classes to implement the actual email sending functionality. The document will be automatically attached with the appropriate filename and MIME type.

SendMailMessage(MailMessage)

Sends an e-mail message containing a report document to its recipients. Override this method in order to effectively send the mail message.

Declaration
protected virtual HttpStatusCode SendMailMessage(MailMessage mailMessage)
Parameters
System.Net.Mail.MailMessage mailMessage

The mail message to send

Returns
System.Net.HttpStatusCode

The default value is NotImplemented.

Remarks

The default implementation of this method is empty. Override this method in order to use the feature.

Examples
protected override HttpStatusCode SendMailMessage(MailMessage mailMessage)
{
    using (var smtpClient = new SmtpClient("smtp.companyname.com", 25))
    {
        smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
        smtpClient.EnableSsl = true;
        smtpClient.Send(mailMessage);
    }

    return HttpStatusCode.OK;
}
Protected Overrides Function SendMailMessage(ByVal mailMessage As MailMessage) As HttpStatusCode
    Using smtpClient = New SmtpClient("smtp.companyname.com", 25)
        smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network
        smtpClient.EnableSsl = True
        smtpClient.Send(mailMessage)
    End Using

    Return HttpStatusCode.OK
End Function

UnregisterClient(String)

Removes an existing client session and clears all associated cached data.

Declaration
public virtual HttpResponseMessage UnregisterClient(string clientID)
Parameters
System.String clientID

The unique identifier of the client session to be removed.

Returns
System.Net.Http.HttpResponseMessage

An HTTP response with no content (204) indicating successful removal.

Remarks

This operation permanently removes the client session and all associated cached data including report instances and generated documents. Use this method when the client application is finished with report processing to free up server resources.

UpdateAIPrompts(ClientReportSource, AIThreadInfo)

Customizes the predefined AI prompts for GenAI-powered insights functionality.

Declaration
protected virtual void UpdateAIPrompts(ClientReportSource reportSource, AIThreadInfo aiThreadInfo)
Parameters
ClientReportSource reportSource

The report source configuration that defines the report instance being analyzed.

AIThreadInfo aiThreadInfo

The AI thread information containing default prompts and configuration from the application settings.

Remarks

Override this method to modify or extend the default AI prompts based on the specific report context or business requirements. This allows customization of the AI interaction experience for different types of reports or user scenarios. The default implementation applies the predefined prompts from the engine configuration.

Getting Started
  • Install Now
  • Online Demos
Support Resources
  • Documentation
  • Knowledge Base
  • Videos
  • Reporting Samples Repository
  • Reporting Release History
Community
  • Forums
  • Blogs
  • Reporting Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.