using the asp.net mvc generic layout with report

1 Answer 50 Views
.NET Framework Report Viewer - ASP.NET
Raymond
Top achievements
Rank 1
Veteran
Raymond asked on 07 Feb 2024, 05:29 PM

hi everybody,

I would like to know if it is possible to have the asp.net mvc generic layout (the one we have when creating a web app) with report, so far I just have report layout.

any suggestion, thanks

Ray

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 09 Feb 2024, 03:45 PM

Hello Ray,

I confirm that it is possible to have the HTML5-based Report Viewers displayed as a part of the page rather than taking up the whole page. The web viewers are normal HTML elements and you can apply any styling(CSS) as you normally would to any HTML element.

    <style>
        #reportViewer1 {
            position: relative;
            width: 1000px;
            height: 700px;
        }
    </style>

    ...    

    <div id="reportViewer1">
        loading...
    </div>

    ...

    <script type="text/javascript">
        $(document).ready(function () {
            $("#reportViewer1")
                .telerik_ReportViewer({
                    serviceUrl: "api/reports/",
                    reportSource: {
                        report: "Report Catalog.trdp",
                    }
                });
        });
    </script>

If you need assistance with setting up the report viewer, you may visit the Configuring HTML5 Report Viewer with Telerik Reporting REST Service - Telerik Reporting article.

Please let me know if you have any additional questions.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Raymond
Top achievements
Rank 1
Veteran
commented on 10 Feb 2024, 05:16 PM

Hi Dimitar, thanks for your feedback, i still have issue to have the report in the app template:

when I try to include the HTML5 I have the following

thanks for the help

Ray

Dimitar
Telerik team
commented on 12 Feb 2024, 02:16 PM

Hi Ray,

Judging by the embedded image, it appears as if the report viewer styles are not loaded on the page. Please try to add the following stylesheets to the page with the report viewer or on a shared page:

<!-- the required Kendo styles -->
<link href="https://kendo.cdn.telerik.com/2022.3.913/styles/kendo.common.min.css" rel="stylesheet" />
<link href="https://kendo.cdn.telerik.com/2022.3.913/styles/kendo.blueopal.min.css" rel="stylesheet" />

If there are issue even after adding the stylsheets, please visit the Integrating ASP.NET MVC Report Viewer With Reporting REST Service - Telerik Reporting and follow the steps listed there to set up the viewer in your application using the Visual Studio item templates.

Alternatively, you can also set it up manually - Manually Setting Up the HTML5 MVC Report Viewer - Telerik Reporting but the item templates do most of the work for you and I would recommend sticking with that approach until you get more familiar with Telerik Reporting.

 

Raymond
Top achievements
Rank 1
Veteran
commented on 13 Feb 2024, 05:10 PM

Hi Dimitar,

is using bootstrap can create such problem?

I have followed the two links you provided and no better result

Dimitar
Telerik team
commented on 14 Feb 2024, 03:45 PM

Hi Ray,

If you mean the bootstrap stylesheets that come with the ASP.NET Framework MVC project template, I have used the template before and haven't had an issue so I don't think that bootstrap is responsible for the problem with the viewer.

Besides the Kendo themes, the viewer also needs to have jQuery loaded on the page for the viewer's JS code, for example:

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

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

If you have those loaded but the report viewer still does not render correctly, please send me the project that you have created so far and I will try to make the necessary changes locally and send you the updated version.

Raymond
Top achievements
Rank 1
Veteran
commented on 16 Feb 2024, 09:48 AM

hi Dimitar,

I have created a basic project, it can be downloaded here: https://transfert.free.fr/QUFsgm5

it is a basic VS2019 ASP.NET MVC project converted to a Telerik project to which I included a Telerik Report Viewer View with Rest service and Sample Report Definition.

many thanks for your help

Ray

Raymond
Top achievements
Rank 1
Veteran
commented on 16 Feb 2024, 02:31 PM

same file but with a longer download availability : https://transfert.free.fr/Id8HAg6

 

Dimitar
Telerik team
commented on 20 Feb 2024, 02:29 PM

Hi Ray,

I wasn't able to run the linked project, I am afraid. However, from what I saw, it uses an older version of the product which seems to be an internal build as I do not see it listed in the Telerik Reporting Release History.

This means that the issue could be specific to the internal. I noticed that you have started a trial with the Telerik Reporting product so my suggestion is to upgrade to the latest version - Telerik Reporting - Progress® Telerik® Reporting 2024 Q1 (18.0.24.130), and then update the scripts and stylesheet references as I have shown above.

If you have problems even with the official version, please generate and send me the following logs:

Raymond
Top achievements
Rank 1
Veteran
commented on 22 Feb 2024, 05:09 PM

Hi, 

I tried the "old" Reporting commercial version as well as the 2024 and got similar results. If the integration of the report is possible in ASP.NET MVC, will it be possible to see an example.

thanks

Ray

Dimitar
Telerik team
commented on 23 Feb 2024, 01:59 PM

Hello Ray,

You may find a sample MVC project with the HTML5 MVC Report Viewer in the installation directory - C:\Program Files (x86)\Progress\Telerik Reporting 2024 Q1\Examples\CSharp\.NET Framework\AspNetMvcIntegrationDemo.

If you follow the first part of the Integrating ASP.NET MVC Report Viewer With Reporting REST Service - Telerik Reporting article, where the VS item templates are used, you will be able to integrate the report viewer in your application without writing any code manually, please do try this approach if you haven't already.

If you continue to have issues, please record and share with me a Fiddler Jam log so that I can see what are the errors - First Steps with the Chrome Extension - Fiddler Jam (telerik.com).

Tags
.NET Framework Report Viewer - ASP.NET
Asked by
Raymond
Top achievements
Rank 1
Veteran
Answers by
Dimitar
Telerik team
Share this question
or