Class ReportsControllerBase
Base Web API controller for exposing the Telerik Reporting REST Service in an ASP.NET Core application.
Inheritance
Namespace: Telerik.Reporting.Services.AspNetCore
Assembly: Telerik.Reporting.Services.AspNetCore.dll
Syntax
[ReportsExceptionFilter]
public abstract class ReportsControllerBase : Controller
Constructors
ReportsControllerBase()
Declaration
protected ReportsControllerBase()
Properties
ReportServiceConfiguration
Declaration
public IReportServiceConfiguration ReportServiceConfiguration { get; set; }
Property Value
IReportServiceConfiguration
|
Methods
CreateCache()
Creates an ICache implementation instance that will be used for internal storage from the service.
Declaration
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
CreateDocument(String, String, CreateDocumentArgs)
Creates new document using specific format and format settings
Declaration
public virtual IActionResult CreateDocument(string clientID, string instanceID, CreateDocumentArgs args)
Parameters
System.String
clientID
The clientID in which session the document is created |
System.String
instanceID
The report instance used for the document |
CreateDocumentArgs
args
Arguments containing the document format and settings |
Returns
Microsoft.AspNetCore.Mvc.IActionResult
|
CreateInstance(String, ClientReportSource)
Creates a new report instance in a client session
Declaration
public virtual IActionResult CreateInstance(string clientID, ClientReportSource reportSource)
Parameters
System.String
clientID
The clientID for which the instance is created |
ClientReportSource
reportSource
The report source which defines the report instance |
Returns
Microsoft.AspNetCore.Mvc.IActionResult
|
CreateJsonResponse(HttpStatusCode, Object)
Declaration
protected JsonResult CreateJsonResponse(HttpStatusCode statusCode, object result)
Parameters
System.Net.HttpStatusCode
statusCode
|
System.Object
result
|
Returns
Microsoft.AspNetCore.Mvc.JsonResult
|
CreateMailMessage(SendDocumentArgs, DocumentData)
Creates the mail message that will be used in SendDocument
Declaration
protected virtual MailMessage CreateMailMessage(SendDocumentArgs args, DocumentData result)
Parameters
SendDocumentArgs
args
The args to use in the mail message |
DocumentData
result
The document to attach to the mail message |
Returns
System.Net.Mail.MailMessage
Mail message |
CreateReportResolver()
Creates an
Declaration
[Obsolete("The virtual method Telerik.Reporting.Services.AspNetCore.ReportsControllerBase.CreateReportResolver is now obsolete. Please pass an instance of the Telerik.Reporting.Services.IReportSourceResolver interface using the Telerik.Reporting.Services.AspNetCore.ReportsControllerBase.ReportServiceConfiguration property instead.")]
protected virtual IReportResolver CreateReportResolver()
Returns
IReportResolver
|
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.
CreateStorage()
Creates an IStorage implementation instance that will be used for internal storage from the service.
Declaration
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
See Also
DeleteDocument(String, String, String)
Deletes concrete document by its ID.
Declaration
public virtual void DeleteDocument(string clientID, string instanceID, string documentID)
Parameters
System.String
clientID
The client session ID which contains the deleted document |
System.String
instanceID
The report instance used for the document |
System.String
documentID
The ID of the deleted document |
DeleteInstance(String, String)
Deletes a report instance in a client session
Declaration
public virtual void DeleteInstance(string clientID, string instanceID)
Parameters
System.String
clientID
The clientID for which the instance is deleted |
System.String
instanceID
The instanceID that is deleted |
ExecuteInteractiveAction(String, String, String, String)
Executes an interactive action that should be applied on the server
Declaration
public virtual void ExecuteInteractiveAction(string clientID, string instanceID, string documentID, string actionID)
Parameters
System.String
clientID
The client session ID which contains the document |
System.String
instanceID
The report instance used for the document |
System.String
documentID
The ID of the affected document |
System.String
actionID
The ID of the executed action |
GetBasePath()
Gets the base path for document resources, e.g. images.
Declaration
protected virtual string GetBasePath()
Returns
System.String
The base path |
GetClientsSessionTimeoutSeconds()
Gets the ClientSessionTimeout
Declaration
public virtual IActionResult GetClientsSessionTimeoutSeconds()
Returns
Microsoft.AspNetCore.Mvc.IActionResult
The client session timeout in seconds |
GetDocument(String, String, String)
Gets the document for a single-stream document formats
Declaration
public virtual IActionResult GetDocument(string clientID, string instanceID, string documentID)
Parameters
System.String
clientID
The client session ID which contains the document |
System.String
instanceID
The report instance used for the document |
System.String
documentID
The ID of the document |
Returns
Microsoft.AspNetCore.Mvc.IActionResult
|
GetDocumentFormats()
Gets the available document formats.
Declaration
public virtual JsonResult GetDocumentFormats()
Returns
Microsoft.AspNetCore.Mvc.JsonResult
|
GetDocumentInfo(String, String, String)
Gets info for a requested document
Declaration
public virtual IActionResult GetDocumentInfo(string clientID, string instanceID, string documentID)
Parameters
System.String
clientID
The client session ID which contains the document |
System.String
instanceID
The report instance used for the document |
System.String
documentID
The ID of the document |
Returns
Microsoft.AspNetCore.Mvc.IActionResult
|
GetPage(String, String, String, Int32)
Gets a page from a document in a multi-stream document format
Declaration
public virtual IActionResult GetPage(string clientID, string instanceID, string documentID, int pageNumber)
Parameters
System.String
clientID
The client session ID which contains the document |
System.String
instanceID
The report instance used for the document |
System.String
documentID
The ID of the document |
System.Int32
pageNumber
The number of the requested page (1-based) |
Returns
Microsoft.AspNetCore.Mvc.IActionResult
|
GetParameters(String, ClientReportSource)
Gets the report parameters for a concrete client and report source
Declaration
public virtual IActionResult GetParameters(string clientID, ClientReportSource reportSource)
Parameters
System.String
clientID
The clientID for which the parameters are retrieved |
ClientReportSource
reportSource
The report source for which the parameters are retrieved |
Returns
Microsoft.AspNetCore.Mvc.IActionResult
|
GetResource(String, String)
Gets an embedded report viewer resource.
Declaration
public virtual IActionResult GetResource(string folder, string resourceName)
Parameters
System.String
folder
The folder in which the resource is. |
System.String
resourceName
The name of the resource. |
Returns
Microsoft.AspNetCore.Mvc.IActionResult
The resource file. |
GetResource(String, String, String, String)
Gets a resource part of a document in multi-stream document format
Declaration
public virtual void GetResource(string clientID, string instanceID, string documentID, string resourceID)
Parameters
System.String
clientID
The client session ID which contains the document |
System.String
instanceID
The report instance used for the document |
System.String
documentID
The ID of the document |
System.String
resourceID
The ID of the requested resource |
GetSearchResults(String, String, String, SearchArgs)
Retrieves the search metadata from resources and returns the search results that satisfies the passed arguments
Declaration
public virtual IActionResult GetSearchResults(string clientID, string instanceID, string documentID, SearchArgs args)
Parameters
System.String
clientID
The clientID in which session the document is created |
System.String
instanceID
The report instance used for the document |
System.String
documentID
The ID of the deleted document |
SearchArgs
args
The arguments used to perform the search |
Returns
Microsoft.AspNetCore.Mvc.IActionResult
|
GetUserIdentity()
Override this method to substitute the default UserIdentity retrieval logic, which uses Microsoft.AspNetCore.Mvc.ControllerBase.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 of Telerik Reporting
Declaration
public virtual JsonResult GetVersion()
Returns
Microsoft.AspNetCore.Mvc.JsonResult
Version number in string format |
KeepClientAlive(String)
Keeps the client alive, extending it by ClientSessionTimeout
Declaration
public virtual IActionResult KeepClientAlive(string clientID)
Parameters
System.String
clientID
The id of the client to be kept alive |
Returns
Microsoft.AspNetCore.Mvc.IActionResult
No content (204) or a bad request (400) if the client has expired |
RegisterClient()
Registers new HTTP service client
Declaration
public virtual IActionResult RegisterClient()
Returns
Microsoft.AspNetCore.Mvc.IActionResult
|
SendDocument(String, String, String, SendDocumentArgs)
Sends an e-mail message containing a report document to its recipients.
Declaration
public virtual void SendDocument(string clientID, string instanceID, string documentID, SendDocumentArgs args)
Parameters
System.String
clientID
The clientID in which session the document is created |
System.String
instanceID
The report instance used for the document |
System.String
documentID
The ID of the rendered document |
SendDocumentArgs
args
The arguments used to send a mail message |
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 existing client of the HTTP service by its ID
Declaration
public virtual void UnregisterClient(string clientID)
Parameters
System.String
clientID
The ID of the client to be removed |
Remarks
All cached data for the client will be cleared.