Deploy .net core 3.1 on azure

0 Answers 22 Views
Report Viewer Rest API
Thummawit
Top achievements
Rank 1
Thummawit asked on 22 Jul 2021, 12:08 PM

I have an issue on deploy my project on azure. I use a trial license right now and when I run my project on localhost it can work properly but when I publish my project on azure I got an error on javascript show me "Uncaught ReferenceError: telerikReportViewer".

I think it's about "<script src="~/api/reports/resources/js/telerikReportViewer"></script>" 

any suggestion ? and where is the actual location of "api/reports/resources/js/telerikReportViewer" on my local, I don't see any.

Dimitar
Telerik team
commented on 27 Jul 2021, 10:30 AM

Generally, the error indicates that the object telerikReportViewer is not defined, probably due to the viewer's JavaScript file not being loaded. The reason for this is not clear based on the available information and we need to investigate further.

The resources needed by the viewer are served by the REST Service. For that reason, we need to check whether it is working correctly. This can be done with a Get request to the Url 'serviceHost/api/reports/formats' - see Get Available Document Formats.

If the service is working as expected and the above request returns a JSON with the rendering extensions, you may troubleshoot further by tracking the requests made by the viewer to the service - I suggest to install the Fiddler Jam extension then generate a log and share it with us.

I also recommend attaching a trace listener to the service project to see whether there will be errors logged when the problem replicates. I hope the trace log will give more information on what goes wrong - Troubleshooting reporting implementation into ASP.NET Core application.

Regarding the location of the Telerik report viewer JS files, if you installed the product with the default settings, they should be at the following location:

C:\Program Files (x86)\Progress\Telerik Reporting <Version>\Html5\ReportViewer\js

We would be looking forward to your response.

Thummawit
Top achievements
Rank 1
commented on 29 Jul 2021, 05:27 AM

I get Error 500 on requesting for serviceHost/api/reports/formats. I think the problem is I can't install Telerik report viewer on Azure. So it can not access to js file and give an error and not even start to request anything but on my local host which telerik report viewer is installed everything is fine. So is there any way to install telerik report viewer on Azure ?
Dimitar
Telerik team
commented on 02 Aug 2021, 11:52 AM

It is not necessary to install Telerik Reporting itself on Azure in order to use the report viewer. However, the project hosted on Azure should have access to the Telerik Reporting NuGet feed so that you can use the Telerik Reporting packages. For more information, please see the Azure DevOps and Telerik NuGet Packages blog post.

You may also use the DLLs from the installation folder instead of NuGet packages if you prefer but in that case, you must protect them from Redistribution. Meaning that this project cannot be open source, or allow a way for other unlicensed people from taking the DLLs for use on other projects. 

In order for this to work, you need to check in all the Telerik DLLs with your code and use assembly references pointing to where those DLLs were placed. Fair warning, this can get very messy, very fast.

If you must take this approach, our recommendation is to create a "libs" folder at your project root where you can place the assemblies in. Then in the projects, you reference the assemblies in that location.

Regarding the JS files for the report viewer, the files do not have to be referenced locally from a folder, I mentioned the location of the file locally because that was asked. Those files are also served from the service itself, if they are not found, for some reason, on Azure, try editing the path - Error 404 Resource not found.

If you need further help, please generate the requested logs from the last reply and attach them to your reply.

No answers yet. Maybe you can help?

Tags
Report Viewer Rest API
Asked by
Thummawit
Top achievements
Rank 1
Share this question
or