MVC ReportViewer inside Kendo Window

2 posts, 0 answers
  1. Sasa
    Sasa avatar
    25 posts
    Member since:
    Jul 2013

    Posted 03 Dec 2015 Link to this post

    I have partial view:

    @section head
    {
        <script src="~/ReportViewer/js/telerikReportViewer-8.1.14.804.js"></script>
        <script src="~/ReportViewer/js/resources.hr-HR.js"></script>
        <link href="~/ReportViewer/styles/telerikReportViewer-8.1.14.804.css" rel="stylesheet" />
        <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css"
              rel="stylesheet">
        <style>
            #reportViewer1 {
                position: absolute;
                left: 15px;
                right: 15px;
                top: 65px;
                bottom: 50px;
                overflow: hidden;
            }
        </style>
    }
     
    @{
        var typeReportSource = new TypeReportSource() { TypeName = string.Format("ATICRaspored.Reports.{0}, ATICRaspored", ViewBag.ReportName) };
        typeReportSource.Parameters.Add("PredavacId", new Guid(((ClaimsIdentity)User.Identity).FindFirst("PredavacId").Value));
        typeReportSource.Parameters.Add("AkGodId", ViewBag.AkGodId);
        typeReportSource.Parameters.Add("AkGodNaziv", ViewBag.AkGodNaziv);
    }
     
    @(
     Html.TelerikReporting().ReportViewer()
      .Id("reportViewer1")
      .ServiceUrl("/api/reports/")
      .TemplateUrl(Url.Content("~/ReportViewer/templates/telerikReportViewerTemplate-8.1.14.804.html"))
      .ReportSource(typeReportSource)
      .ViewMode(ViewModes.PRINT_PREVIEW)
      .ScaleMode(ScaleModes.SPECIFIC)
      .Scale(1)
      .PrintMode(PrintMode.AutoSelect)
    )

    On button click I need to show my partial view inside kendo window. My code is:

    @(Html.Kendo().Window().Name("ReportViewer")
        .Title("Izvještaj!")
        .Visible(false)
        .Modal(true)
        .Draggable(true)
        .Resizable(x => x.Enabled(true))
        .Width(800)
        .Height(800))
     
    <script>
        $("#btnReportKolegij").click(function () {
            var site = site || {};
            site.baseUrl = site.baseUrl || "";
     
            var wnd = $("#ReportViewer").data("kendoWindow");
            wnd.refresh(site.baseUrl + "/Home/_ReportContainer/" + '@Model.Id' + "/" + '@Model.GodineMerge.Replace('/', '-')' + "/EvidencijaOdrzaneNastaveKolegij").center().open();
        });
    </script>

     

    On click my window is opened but it's only showing "Loading..." as you can see on the attached image. Without kendo window and with simple view everything is working.

    What am I missing?

    Thanks

  2. Nasko
    Admin
    Nasko avatar
    909 posts

    Posted 08 Dec 2015 Link to this post

    Hello Sasa,

    Most probably the viewer's resources cannot be found by the widget. Please run Fiddler to see which requests fail.

    In case the issue persists, please open a support ticket where you can zip and attach a sample project exhibiting the issue. We will review it and then will be able to provide additional suggestions.

    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top