Unable to get report parameters error when reporting REST service is running in Docker container

1 Answer 204 Views
General Discussions Report Viewer - HTML5 Rest Service
Tursunkhuja
Top achievements
Rank 2
Iron
Iron
Veteran
Tursunkhuja asked on 15 Oct 2022, 08:01 PM

Hi,
I'm having problem when showing report when I run Telerik Reporting REST service is Docker (Linux OS). As a report viewer I use HTML5 report viewer. For serviceUrl we can set http port of current host port from the container. The problem is when we preview the demo report, it shows like this error: "Unable to get report parameters..."

You can see the Demo project from my GitHub to reproduce the problem.

Project with html5 report viewer: Tursunkhuja/Telerik-HTML5-Report-Viewer-in-UWP: Show HTML5 report viewer in UWP window (github.com)
Project with reporting service project: Tursunkhuja/Telerik-Reporting-REST-Service: Telerik Reporting REST service. Docker (Linux OS) is enabled. (github.com)

Any idea on how to run Rest Service project in Docker correctly?

FYI: If we use "IIS" to run the Rest Service project, it works fine so it will show the demo report (Barcode examples report) without any error.

 

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 19 Oct 2022, 01:27 PM

Hi Tursunkhuja,

I suspect you are experiencing the problem described in the KB System.Drawing.Common is not supported on non-Windows platforms - .NET 6 under Linux. I suggest testing the solution described in the KB.

Regards,
Todor
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/.
Tursunkhuja
Top achievements
Rank 2
Iron
Iron
Veteran
commented on 19 Oct 2022, 04:04 PM

Hi Todor,

I added runtimeconfig.template.json file as described in the KB, but I have the same problem. Can you test it with my Demo projects please?

Lance | Manager Technical Support
Telerik team
commented on 19 Oct 2022, 06:38 PM

Hi Tursunkhuja,

There was a general .NET programming problem with the ASP.NET project, I want able to get it to work under any circumstance (Docker, Linux or IIS on Windows). Even when the site first runs, Index.html doesn't work.

I spent some time debugging and working on the non-Telerik issues and have it working.

  • Once I enabled app.UseStaticFiles(), initial site navigation was working
  • Your ReportsController.cs class didn't have the [ApiController] attribute. This is a serious problem, it would prevent the REST from being routed. you can always test this by going to mydomain.com/api/reports/formats
  • I also fixed the Dockerfile. It would not have worked because it would have been impossible to compile the project, I can now confirm a Docker build and a WSL deployment build work as expected.

All of the above changes, and come clarifying code comments are available in my pull request => Reporting REST Service Support by LanceMcCarthy · Pull Request #1 · Tursunkhuja/Telerik-Reporting-REST-Service (github.com)

 

For your convenience, here's a screenshot from my Docker test. I verify the REST service is working by checking the api/reports/formats endpoint.

Lance | Manager Technical Support
Telerik team
commented on 19 Oct 2022, 08:23 PM | edited

As a quick follow up, I wanted to let you know that I have updated my DevOpsExamples repository to include a Telerik Reporting REST service in the docker example.

This means you can test this for yourself right now with a simple docker command:

docker run -d --name lance-reporting -p 80:80 lancemccarthy/myaspnetcoreapp:latest

Once the container is running, you can test the reports API http://localhost:80/api/reports/formats. You can also fetch Barcodes Report.trdp from it as well.

Tursunkhuja
Top achievements
Rank 2
Iron
Iron
Veteran
commented on 20 Oct 2022, 12:29 PM

Hi Lance,

I'm still getting this error when I connect with my TestReportApp project. But the reporting service is working fine though. 

Lance | Manager Technical Support
Telerik team
commented on 21 Oct 2022, 02:55 PM

I am able reproduce this. It initially appears to be related to the default serialization being used in that .NET 6 REST project. Mainly, Telerik Reporting uses Json.NET and not System.Text.Json, so this could be what's happening... but I'm not sure yet. I will coordinate with Todor to work on a solution and then update you on the progress.

Lance | Manager Technical Support
Telerik team
commented on 21 Oct 2022, 03:46 PM

Okay, I have an answer for you. Default serializer problems is not relevant here because your Program.cs is already using AddNewtonsoftJson() in the services configuration.

Item 1

Make sure the Linux dependencies are actually getting installed in your environment (container or OS). You can ensure this this by moving the apt commands to the base section:

Important Notes:

  • If you are not using Docker/containers, then you must manually install those items. Open a bash terminal inside the OS and run the same command the Dockerfile uses.
    • apt-get update \
          && apt-get install -y --allow-unauthenticated \
              libc6-dev \
              libgdiplus \
              libx11-dev \
           && rm -rf /var/lib/apt/lists/*
  • If you are using containers, I recommend completely deleting the container before deploying it again. I noticed some problems where the container was not being recreated when deploying form Visual Studio, so it never had a chance to use the apt commands.

Option 2

The other reason you might be having a problem is incorrect parameter settings in the report viewer itself. Remove the null parameters array.

Demo

To verify this, you can again try my demo => https://github.com/LanceMcCarthy/DevOpsExamples/tree/main/src/AspNetCore (I pushed these changes a couple minutes ago).

Here's a screenshot at runtime:

Tags
General Discussions Report Viewer - HTML5 Rest Service
Asked by
Tursunkhuja
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Todor
Telerik team
Share this question
or