Flexviewer and Asp.Net Core 2.0

Posted by: dcol on 4 February 2018, 5:29 am EST

    • Post Options:
    • Link

    Posted 4 February 2018, 5:29 am EST

    Last fall I created a project that displays Flexviewer reports using VS2015 ASP.NET Core 1.1 and .Net Framework 4.6.1 but NOT with a separate report service. Rather, the reports were in the wwwroot/ReportsRoot folder. The three C1 references I used are:

    “C1.AspNetCore.Mvc.FlexViewer”: “1.0.20173.143”,

    “C1.AspNetCore.Mvc”: “1.0.20173.143”,

    “C1.AspNetCore.Api.Report”: “1.0.20172.119”

    (Note: I have updated to these version recently with no issues. At the time I was using 20172.129, 20172.129 and 20172.105)

    At the end of Startup/Configure I have the following that is dependent on C1.AspNetCore.Api.Report: app.UseReportProviders().AddFlexReportDiskStorage(“ReportsRoot”, Path.Combine(env.WebRootPath, “ReportsRoot”));

    This month I have re-written the whole project in ASP.NET Core 2.0. (It was somewhat unsettling looking at the C1 Documentation for Flexviewer and seeing that there is no reference to ASP.NET 2.0 and the instruction are still that a separate report service must be created.)

    In the VS2017 ASP.NET 2.0 project when I bring in C1.AspNetCore.Api.Report, there is an error message that it was “restored using .NetFramework, Version 4.6.1’ instead of the project framework ‘NETCoreApp=v2.0’. This package may not be full compatible with your project.”

    This warning is pertinent to my project because the line in Startup, app.UseReportProviders().AddFlexReportDiskStorage(“ReportsRoot”, Path.Combine(env.WebRootPath, “ReportsRoot”));

    no longer works. I tried installing version 105 of C1.AspNetCore.Api.Report but with no change.

    Last Sep 25 I received a response that I understood to mean that, using ASP.NET 2.0, I would be able to even more simply include the Flexviewer report files in the same project, so I extended my license. What now?

    Thanks.

  • Posted 4 February 2018, 6:58 am EST

    To partially answer my own issue:

    When I created the VS 2017 project, I selected .NET Core / ASP.NET Core 2.0.

    I have since created another new test project selecting .NET Framework / ASP.NET Core 2.0. With this project, installing C1.AspNetCore.Api.Report does not generate the above error and I am able to produce and display Flexviewer reports successfully as I did within the ASP.NET CORE 1.1 project (which also referred to the .NET Framework).

    I had expected that Flexviewer would by now be able to operate successfully within .NET Core. I suppose that the Reporting engine relies on the GDI+ API which is not available in the .NET Core framework. Do you have plans to remedy this?

    Thanks.

  • Posted 5 February 2018, 12:05 am EST

    Hi,

    If you are including FlexReport in the project, it call C1 WebAPI in background to show the Report in ReportViewer. Hence, it requires .Net Framework. Hence, you need to use Core with .NetFramework.

    Currently, C1 WebAPI services is written with .Net Framework, hence if WebAPI is used in the project, it will required .Net framework.

    You may host WebAPI for ReportService in different project and show Report in ReportViewer using WebAPI in Core 2.0 project.

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels