I have a Web Application using Telerik.Reporting.Services.WebApi with Html5 ReportViewer with a custom controller, where depending on the report type it uses a custom resolver.
There are 3 different report types and each one uses a HostAppId with a custom resolver. The storage is a Telerik.Reporting.Cache.File.FileStorage pointing to the same path for all 3 report types.
But after starting the application and generating the first report type, the other 2 types generates information in the storage path, but the report does not display any information, always being '0 pages loaded so far ...'.
It opens infinite requests - one after another - to an url like this "~/clients/085352-e708/instances/083615-c3d7/documents/085412-2b2a085412-5cbd/info" giving the same json response for them all:
{
"documentReady":false,
"pageCount":0,
"documentMapAvailable":false,
"bookmarkNodes":null,
"documentMapNodes":null
}
I believe that somehow by changing HostAppId, the cache is lost. How I fix this?
ReportBaseController
public class ReportBaseController<TReportResolver> : ReportsControllerBase
where TReportResolver : IReportResolver, new()
{
protected virtual string HostAppId { get; }
protected string ReportCachePath => HttpContext.Current.Server.MapPath($"~/App_Data/reportcache");
public ReportBaseController()
{
if (!Directory.Exists(ReportCachePath))
Directory.CreateDirectory(ReportCachePath);
this.ReportServiceConfiguration = new ReportServiceConfiguration
{
HostAppId = this.HostAppId,
ReportResolver = new TReportResolver(),
Storage = new Telerik.Reporting.Cache.File.FileStorage(ReportCachePath)
};
}
}
Controllers of the 3 different report types:
public class ReportSystemController : ReportBaseController<SystemReportResolver>
{
protected override string HostAppId => "ReportSystem";
}
public class ReportClientController : ReportBaseController<ClientReportResolver>
{
protected override string HostAppId => "ReportClient";
}
public class ReportListController : ReportBaseController<ListReportResolver>
{
protected override string HostAppId => "ReportList";
}
There are 3 different report types and each one uses a HostAppId with a custom resolver. The storage is a Telerik.Reporting.Cache.File.FileStorage pointing to the same path for all 3 report types.
But after starting the application and generating the first report type, the other 2 types generates information in the storage path, but the report does not display any information, always being '0 pages loaded so far ...'.
It opens infinite requests - one after another - to an url like this "~/clients/085352-e708/instances/083615-c3d7/documents/085412-2b2a085412-5cbd/info" giving the same json response for them all:
{
"documentReady":false,
"pageCount":0,
"documentMapAvailable":false,
"bookmarkNodes":null,
"documentMapNodes":null
}
I believe that somehow by changing HostAppId, the cache is lost. How I fix this?
ReportBaseController
public class ReportBaseController<TReportResolver> : ReportsControllerBase
where TReportResolver : IReportResolver, new()
{
protected virtual string HostAppId { get; }
protected string ReportCachePath => HttpContext.Current.Server.MapPath($"~/App_Data/reportcache");
public ReportBaseController()
{
if (!Directory.Exists(ReportCachePath))
Directory.CreateDirectory(ReportCachePath);
this.ReportServiceConfiguration = new ReportServiceConfiguration
{
HostAppId = this.HostAppId,
ReportResolver = new TReportResolver(),
Storage = new Telerik.Reporting.Cache.File.FileStorage(ReportCachePath)
};
}
}
Controllers of the 3 different report types:
public class ReportSystemController : ReportBaseController<SystemReportResolver>
{
protected override string HostAppId => "ReportSystem";
}
public class ReportClientController : ReportBaseController<ClientReportResolver>
{
protected override string HostAppId => "ReportClient";
}
public class ReportListController : ReportBaseController<ListReportResolver>
{
protected override string HostAppId => "ReportList";
}