.NET Core Reporting setup - first time user

1 Answer 55 Views
.NET Core Report Viewer - MVC Rest Service
Joe
Top achievements
Rank 1
Joe asked on 07 Mar 2025, 07:57 PM

I just started to evaluate the Trial Version of Reports. The good news is that I was able to re-create one of my existing Crystal Reports to a Telerik Report using the Designer. The bad news is I can't get the report to display in my existing .NET Core App(.net 9). I get the same error message in this link:

https://docs.telerik.com/reporting/knowledge-base/cannot-access-the-reporting-rest-service

I used this link below to get started. 

https://docs.telerik.com/reporting/embedding-reports/host-the-report-engine-remotely/asp.net-core-web-api-implementation/host-reports-service-in-.net-with-controllers

It says at the bottom of the link that there is a full example in the install folder, but the example only contains the REST service piece, not a full example where a REST is attached to a project.

Anyways, I am not having any luck troubleshooting this error message.  There is a mention of creating a .log file, but that file is not being generated for me. I tried Fiddler - have never used that before. I see this message below popped up., but no idea what that means. Do you have a full working example somewhere with a project and attached REST service?

{"message":"An error has occurred.","exceptionMessage":"Invalid URI: The hostname could not be parsed.","exceptionType":"UriFormatException","stackTrace":null}

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 11 Mar 2025, 02:00 PM

Hello Joe,

I replied to the Support Ticket you opened on the same issue and will copy my message here for the benefit of our community.

We provide working Web Application examples with both a Report Viewer and the required Reporting REST Service with the installation of the product. The default deployment folder is 'C:\Program Files (x86)\Progress\Telerik Reporting 2025 Q1\Examples\CSharp\.NET 9\'.

For example, the project Html5IntegrationDemo contains a viewer in the file '/wwwroot/index.html', and a service configured in the 'Program.cs' file with Minimal Api - Hosting the Telerik Reporting REST Service in ASP.NET Core in .NET 6+ with Minimal API.

In the viewer, the Reporting REST Service URL is referenced twice in this example.

In the <head> section of the HTML file, there is a reference to the viewer's script that is downloaded from the service. Note that the service URL is relative, as both the service and the viewer are in the same project and share the domain name. If your service is running in a separate domain, you may replace the green part with the corresponding 'https://mydomain/api/reports':

<script src="/api/reports/resources/js/telerikReportViewer"></script>

The second reference is in the viewer and specifies the 'serviceUrl', i.e., from where to download the reports:

$("#reportViewer1")
                .telerik_ReportViewer({
                    // For a complete overview over all the parameters check https://docs.telerik.com/reporting/html5-report-viewer-jquery-fn-telerik-reportviewer
                    // In this template there are examples included of the most common parameters

                    // The URL of the service which will serve reports.
                    // The URL corresponds to the name of the controller class (ReportsController).
                    // For more information on how to configure the service please check https://docs.telerik.com/reporting/embedding-reports/host-the-report-engine-remotely/telerik-reporting-rest-services/overview.
                    serviceUrl: "api/reports/",

                    // The URL for the report viewer template. The template can be edited -
                    // new functionalities can be added and unneeded ones can be removed.
                    // For more information please check https://docs.telerik.com/reporting/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/styling-and-appearance/templates-structure.
                    // templateUrl: 'ReportViewer/templates/telerikReportViewerTemplate.html',

                    //ReportSource - report description used with REST service.
                    reportSource: {

                        // The report can be set to a report file name (.trdx or .trdp report definition)
                        // or CLR type name (report class definition).
                        report: "Report Catalog.trdp",

                        // Parameters name value dictionary
                        //parameters: {}
                        // Example of passing an array [] of parameters-values to the parameter 'Year'
                        //parameters: { Year: [2001, 2003, 2004] }
                    },

I suggest trying opening your reports with the above example. You need to save the report in the folder with our TRDP demo reports 'C:\Program Files (x86)\Progress\Telerik Reporting 2025 Q1\Report Designer\Examples\' and replace the viewer's property reportSource report with default value "Report Catalog.trdp" with your report file name.

The steps for configuring the HTML5 Report Viewer are in the article Using the HTML5 Report Viewer in an ASP.NET Core application in .NET 6, .NET 8 and .NET 9.

You may also find useful the article Telerik Report Viewer and Telerik Reporting REST Service.

Regarding the troubleshooting, please check the KB article Troubleshooting Reporting Implementation Into ASP.NET Core Application.

Regards,
Todor
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

Tags
.NET Core Report Viewer - MVC Rest Service
Asked by
Joe
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or