Search results

Migrate Report Viewer application

In our Report Platform release version v4.1.0.x, new reporting assemblies are introduced for both client and server-side to resolve the compatibility problem between Essential Studio and Report Platform Report Viewer versions. It has changes in both Web API service and client-side scripts.

This section provides step-by-step instructions for migrating v3.2.0.42 and below version of Report Viewer ASP.NET Core application to the new Report Platform version:

The following migration changes must be implemented in your existing Report Viewer application. It was created using our Report Platform v3.2.0.42 and below versions.

Client-side migration

  1. To uninstall NuGet, right-click the project or solution in the Solution Explorer tab, and choose Manage NuGet Packages. Search the Syncfusion.EJ.ASPNET.Core NuGet Package and uninstall from your application.

  2. Search for Syncfusion.Reporting.AspNet.Core NuGet package, and install to your application.

Refer to the NuGet Packages section to learn more details about installing and configuring Report Viewer NuGet packages.

Scripts and CSS references

  1. Remove the following scripts and CSS references from the Report Viewer \Views\Shared\_Layout.cshtml page:

    • ej.web.all.min.css
    • ej.web.all.min.js
  2. Add the listed references in the same order given in above list. You can replace the following code in your \Views\Shared\_Layout.cshtml page <head> tag.

    <link href="https://cdn.syncfusion.com/4.1.0.25/js/reports/material/ej.reports.all.min.css" rel="stylesheet" />
    <script src="https://cdn.syncfusion.com/js/assets/external/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/common/ej.reporting.common.min.js"></script>
    <script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/common/ej.reporting.widgets.min.js"></script>
    <script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/ej.report-viewer.min.js"></script>
  3. The component prefix has been changed from ej to sf.

  4. Open the \Views\Shared\_Layout.cshtml page.

  5. Remove the following code <ej-script-manager></ej-script-manager> in your _Layout.cshtml page.

  6. Replace the following code in your _Layout.cshtml page.

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>@ViewData["Title"] - ReportViewerDemo</title>
        <link href="https://cdn.syncfusion.com/4.1.0.25/js/reports/material/ej.reports.all.min.css" rel="stylesheet" />
        <script src="https://cdn.syncfusion.com/js/assets/external/jquery-1.10.2.min.js" type="text/javascript"></script>
        <script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/common/ej.reporting.common.min.js"></script>
        <script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/common/ej.reporting.widgets.min.js"></script>
        <script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/ej.report-viewer.min.js"></script>
    </head>
    <body>
        <div style="min-height: 600px;width: 100%;">
            @RenderBody()
        </div>
    
        @RenderSection("Scripts", required: false)
        <!-- Syncfusion reporting script manager -->
        <sf-script-manager></sf-script-manager>
    </body>
    </html>

Adding data visualization scripts

To render the report with data visualization components such as chart, gauge, and map items, add scripts of the visualization element. The following table shows the script reference that needs to be added in Report Viewer page for data visualization elements.

Visualization item Script file
Chart ej.chart.min.js
Gauge ej.lineargauge.min.js, ej.lineargauge.min.js
Map ej.map.min.js

To render the chart report item, add chart control script ej.chart.min.js before the ej.report-viewer.min.js reference in the \Views\Shared\_Layout.cshtml page as demonstrated in the following code sample.

<link href="https://cdn.syncfusion.com/4.1.0.25/js/reports/material/ej.reports.all.min.css"  rel="stylesheet" />
<script src="https://cdn.syncfusion.com/js/assets/external/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/common/ej.reporting.common.min.js"></script>
<script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/common/ej.reporting.widgets.min.js"></script>

<!--Render the chart item. Add this script only if your report contains the chart report item.-->
<script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/data-visualization/ej.chart.min.js"></script>

<!-- Report Viewer component script-->
<script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/ej.report-viewer.min.js"></script>

The following code can be used to render the chart, gauge, and map report items in Report Viewer.

<link href="https://cdn.syncfusion.com/4.1.0.25/js/reports/material/ej.reports.all.min.css"  rel="stylesheet" />
<script src="https://cdn.syncfusion.com/js/assets/external/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/common/ej.reporting.common.min.js"></script>
<script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/common/ej.reporting.widgets.min.js"></script>

<!--Render the chart item. Add this script only if your report contains the chart report item.-->
<script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/data-visualization/ej.chart.min.js"></script>

<!--Render the gauge item. Add this script only if your report contains the gauge report item. -->
<script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/data-visualization/ej.lineargauge.min.js"></script>
<script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/data-visualization/ej.circulargauge.min.js"></script>

<!--Render the map item. Add this script only if your report contains the map report item.-->
<script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/data-visualization/ej.map.min.js"></script>

<!-- Report Viewer component script-->
<script src="https://cdn.syncfusion.com/4.1.0.25/js/reports/ej.report-viewer.min.js"></script>

Tag helper

  1. Remove following tag helper within the _ViewImports.cshtml page.

        @using Syncfusion.JavaScript
        @addTagHelper *, Syncfusion.EJ
  2. Add following tag helper within the _ViewImports.cshtml page.

        @using Syncfusion.Reporting.TagHelpers
        @addTagHelper *, Syncfusion.Reporting.AspNet.Core

Control initialization

  1. The component prefix has been changed from ej-report-viewer to sf-report-viewer.

  2. Open the Report Viewer CSHTML page.

  3. Replace the component tag ej-report-viewer to sf-report-viewer.

    <sf-report-viewer id="viewer"></sf-report-viewer>

    If your application contains Report Viewer initialization in multiple pages then replace in all the pages.

Server-side migration

  1. To uninstall NuGet, right-click the project or solution in the Solution Explorer tab, and choose Manage NuGet Packages. Search the Syncfusion.EJ.ReportViewer.ASPNET.Core NuGet Package and uninstall from your application.

  2. Search for Syncfusion.Reporting.Net.Core NuGet package, and install to your application.

    Refer to the NuGet Packages section to learn more details about installing and configuring Report Viewer NuGet packages.

Web API Controller

  1. The IReportController interface is moved to Syncfusion.Reporting.Web.ReportViewer. Open the Report Viewer Web API Controller file and remove the following using statement.

    using Syncfusion.EJ.ReportViewer;
  2. Add the following using statement.

    using Syncfusion.Reporting.Web.ReportViewer;
  3. Your application is successfully upgraded to the latest version of Report Viewer, and you can run the application with new assemblies.