List of all files in a folder in Report created with Web Report Designer

1 Answer 147 Views
Report Designer - Web Report Viewer - Angular
Kristof
Top achievements
Rank 1
Kristof asked on 01 Nov 2022, 07:54 AM
We are creating reports with the Web Report Designer (hosted on IIS as ASP.NET Core app) and display the reports with the Angular Report viewer. One requirement is to to show a list of all files in a folder (located at a file server) which is defined by a report parameter. E.g. if the report parameter is "42" a list of all files in the folder "//fileshare/objects/42" are displayed in the report. Is there a way to create reports with this capability with the web report designer or any other report designer tool?

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 03 Nov 2022, 04:11 PM

Hi Kristof,

If I have understood correctly, the idea here is to pass a report parameter specifying a report name/subpath that is then used to display in the same report all available files in that folder, is that correct?

If that is indeed the requirement, then yes, creating such a report should be possible. The main thing will be in deciding how to retrieve the list of folders as available data in the report so that this data can be displayed inside of it.

To me, the easiest solution is to use our ObjectDataSource Component to write a method that will return the files in a directory through C# code. The Directory.GetFiles Method (System.IO) | Microsoft Learn method should get the job done. And the specified folder itself can be passed to the method as an argument through the ObjectDataSource - Using Parameters with the ObjectDataSource Component - Telerik Reporting.

This should get the job but please be careful with the paths to the folders because the root path might change depending on what context is the report being rendered in.

I hope that the provided suggestions will help, please do not hesitate to let me know if you have any further questions.

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Tags
Report Designer - Web Report Viewer - Angular
Asked by
Kristof
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or