Class ReportDesignerHelper
Contains helper methods that help to process Post or Get request from the Report Designer control and returns the response to the Report Designer control.
Inheritance
Namespace: BoldReports.Web.ReportDesigner
Assembly: BoldReports.Web.dll
Syntax
public static class ReportDesignerHelper : Object
Properties
ReportingServer
Gets or sets the external report server.
Declaration
public static ReportingServer ReportingServer { get; set; }
Property Value
Type | Description |
---|---|
ReportingServer |
Methods
GetEncodedCode()
Gets the encrypted key code from header
Declaration
public static string GetEncodedCode()
Returns
Type | Description |
---|---|
System.String | Returns the encrypted key code string |
GetImage(String, String, IReportDesignerController)
Downloads the resource of images in the report.
Declaration
public static object GetImage(string key, string image, IReportDesignerController controller)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The unique key to get the desired image. |
System.String | image | File path of the image, to download. |
IReportDesignerController | controller | WebAPI controller instance. |
Returns
Type | Description |
---|---|
System.Object | Returns the downloaded response of image. |
Examples
public class ReportController : ApiController, IReportDesignerController
{
public object PostDesignerAction(Dictionary<string, object> jsonResult)
{
return ReportDesignerHelper.ProcessDesigner(jsonResult, this, null);
}
[System.Web.Http.ActionName("GetImage")]
[AcceptVerbs("GET")]
public object GetImage(string key, string image)
{
return ReportDesignerHelper.GetImage(key, image, this);
}
...
}
LogError(IReportLogger, String, Exception, MethodBase, ErrorType)
Method can be used to write the exceptions and their details in a log file.
Declaration
public static bool LogError(IReportLogger logger, string message, Exception exception, MethodBase methodType, ErrorType errorType)
Parameters
Type | Name | Description |
---|---|---|
IReportLogger | logger | Logger instance to redirect to the connected interface |
System.String | message | Error message of unexceptional case. |
System.Exception | exception | Represents the error that occur during application execution. |
System.Reflection.MethodBase | methodType | Information about current method. |
ErrorType | errorType |
Returns
Type | Description |
---|---|
System.Boolean | Returns true, if error information successfully written into log file. |
ProcessDesigner(Dictionary<String, Object>, IReportDesignerController, IFormFile, IMemoryCache)
Processes the current designer request and returns the json result.
Declaration
public static object ProcessDesigner(Dictionary<string, object> jsonArray, IReportDesignerController designer, IFormFile httpPostedFile, IMemoryCache memoryCache)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> | jsonArray | A collection of keys and values to process the designer request. |
IReportDesignerController | designer | The ReportDesigner uses Web API services to process the report file, process the request from control, and to return the processed data to control. |
Microsoft.AspNetCore.Http.IFormFile | httpPostedFile | Information about the file to be upload |
Microsoft.Extensions.Caching.Memory.IMemoryCache | memoryCache | Gets the cache value as Microsoft.Extensions.Caching.Memory.IMemoryCache |
Returns
Type | Description |
---|---|
System.Object | Json result for the current request. |
Examples
public class ReportController : ApiController, IReportDesignerController
{
[HttpPost]
public object PostDesignerAction([FromBody] Dictionary<string, object> jsonResult)
{
return ReportDesignerHelper.ProcessDesigner(jsonResult, this, null, this._cache);
}
...
}