Completed
Last Updated: 16 Sep 2020 13:06 by ADMIN
Release 2020 R3
n/a
Created on: 31 Aug 2020 09:10
Type: Bug Report
2
The default implementation of FileDefinitionStorage works only on Windows platform
The default implementation of ListDefinitions() method trims slashes using hard-coded character instead of using environment-specific characters like Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar. Due to that slash the reports cannot be loaded on Linux (see image below).
Image
1 comment
ADMIN
Neli
Posted on: 31 Aug 2020 09:24

Hi,

The workaround is to override the ListDefinitions method:

publicclassStartup {

. . .

// Configure dependencies for ReportDesignerController. services.TryAddSingleton<IReportDesignerServiceConfiguration>(sp => new ReportDesignerServiceConfiguration { DefinitionStorage = new MyFileDefStorage( Path.Combine(sp.GetService<IHostingEnvironment>().ContentRootPath, "..", "..", "..", "Report Designer", "Examples")), SettingsStorage = new FileSettingsStorage( Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Telerik Reporting")), }); . . . } class MyFileDefStorage : FileDefinitionStorage { public MyFileDefStorage(string baseDir) : base(baseDir) { } public override IEnumerable<string> ListDefinitions() { var reportPatterns = new string[] { "*.trdx", "*.trdp" }; foreach (var pattern in reportPatterns) { var files = Directory.GetFiles(this.BaseDir, pattern, SearchOption.AllDirectories); foreach (var file in files) { var definitionId = file.Replace(this.BaseDir, string.Empty).TrimStart(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); yield return definitionId; } } } }

 

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.