Shared Data Source - default configuration for BOTH Viewer and DESIGNER not working - wrong path.

1 Answer 82 Views
Report Designer - Web Report Viewer - Blazor
Michal
Top achievements
Rank 1
Iron
Iron
Michal asked on 02 Jul 2024, 01:00 PM

Hi,

 does someone figure out, how is intended to "sdsx"  - shared data source should be working in single project, for designing and configuring reports?

the problem:

- designer is OK(left window at picture) and showing data = working, BUT "shared datasources \ *.sdsx" files  are displayed at WRONG tree - > at number 2. It should be at 1.

- viewer fails, complaining, that sdsx cannot be found. But is lookig at wrong folder number: 4. It should be lookig to 1. which is also 5.

structure is default from documentation:

Reports located at: ...\Reports\ *.trdp
Sources located at: ...\Reports\Shared Data Sources\ *.sdsx

 

- How to tel the VIEWER(right window at picture), to look at \Reports\Shared Data Sources\  instead only at \Reports\ for *.sdsx files?

confih at picture, with PATHS:
#region REPORTING
services.TryAddSingleton<IReportServiceConfiguration>(sp => new ReportServiceConfiguration
{
	ReportingEngineConfiguration = sp.GetService<IConfiguration>(),
	HostAppId = "BlazorWebReportDesignerDemo",
	Storage = new FileStorage(),
    ReportSourceResolver = new UriReportSourceResolver(Path.Combine(sp.GetService<IWebHostEnvironment>().WebRootPath, "Reports")),
    //ReportSourceResolver = new UriReportSourceResolver(Path.Combine(sp.GetService<IWebHostEnvironment>().WebRootPath, "Reports", "Shared Data Sources")),
});
services.TryAddSingleton<IReportDesignerServiceConfiguration>(sp => new ReportDesignerServiceConfiguration
{
	DefinitionStorage = new FileDefinitionStorage(Path.Combine(sp.GetService<IWebHostEnvironment>().WebRootPath, "Reports")),
	SettingsStorage = new FileSettingsStorage(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Telerik Reporting")),
	ResourceStorage = new ResourceStorage(Path.Combine(sp.GetService<IWebHostEnvironment>().WebRootPath, "Resources")),
    SharedDataSourceStorage = new FileSharedDataSourceStorage(Path.Combine(sp.GetService<IWebHostEnvironment>().WebRootPath, "Reports", "Shared Data Sources")),
    //SharedDataSourceStorage = new FileSharedDataSourceStorage(Path.Combine(sp.GetService<IWebHostEnvironment>().WebRootPath, "Reports"), new string[] { "Shared Data Sources" })
});
#endregion

 

Thanks for the tips, or how its supposed to work - with not all files in one directory.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 05 Jul 2024, 08:51 AM

Hello Michael,

Thank you for the screenshots and the additional information!

The base directory is different at runtime when the report is previewed in the report viewer, and this causes the DefaultSharedDataSourceResolver to look in the wrong place for the SDSX file.

The solution is to specify the path to folder with the shared data source files in the configuration file of the project(e.g. appsettings.json):

"telerikReporting": {
    "processing": {
        "sharedDataSourceResolver": {
            // The element below represents an implementation of a SharedDataSource resolver that uses a path provider:
            "provider": "path",
            "parameters": [
              {
                "name": "directory",
                "value": "c:\\CommonSharedDataSources\\"
              }
            ],
        }
    }
}

For more information on the topic and examples, you may refer to the Configuring the processing Element - Telerik Reporting article.

Regarding the issue with the Shared Data Source folder displaying twice in the three, it is necessary to exclude that folder from the FileDefinitionStorage so that it does not show under the Reports tree in the Asset Manager, for example:

builder.Services.TryAddSingleton<IReportDesignerServiceConfiguration>(sp => new ReportDesignerServiceConfiguration
{
    DefinitionStorage = new FileDefinitionStorage(reportsPath, new[] { "Resources", "Shared Data Sources" }),
    ...
});

Please try the suggested solutions and let me know if you need further assistance.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Michal
Top achievements
Rank 1
Iron
Iron
commented on 05 Jul 2024, 04:57 PM

Hi Dimitar,

 thanks. Both of your suggetions scores. :)

- *.json config = for the shared resources directory
- exclude parameter in DefinitionStorage, to hide duplicated folders

Not all parameters are exposed at code level -  Much more of them are located at config file - it was also missing part in my mindset.

Tags
Report Designer - Web Report Viewer - Blazor
Asked by
Michal
Top achievements
Rank 1
Iron
Iron
Answers by
Dimitar
Telerik team
Share this question
or