This is a migrated thread and some comments may be shown as answers.

Problem With Storage(FileStorage) when changing HostAppId

1 Answer 448 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Fernando
Top achievements
Rank 1
Fernando asked on 03 Oct 2018, 01:30 PM
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";
}

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 05 Oct 2018, 03:31 PM
Hello Fernando,

The FileStorage implementation is not suitable to work with multiple Reporting REST service instances. You can use a storage implementation suitable for multiple-instance scenario: IStorage implementation suitable for deploying in Web Farms.

Another option would be to use a single service per application. What is the purpose of the different ReportsControllerBase implementations in your application?

Regards,
Nasko
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Fernando
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or