使用ASP.NET MVC在浏览器中显示SSRS报告页面?

时间:2013-03-28 13:10:56

标签: asp.net html asp.net-mvc asp.net-mvc-3 reporting-services

我只是想在ASP.NET MVC视图中显示SSRS报告页面。没有什么花哨。不试图使用webforms的reportviewer控件或任何东西。我尝试在视图中使用<iframe>。但是,它不占用页面的整个主体,如果我尝试单击SSRS上的任何文件夹,也会抛出下面的JScript错误。

enter image description here

“Microsoft JScript运行时错误:无法设置属性'className'的值:object为null或undefined”

以下是我的观点和控制器。

Layout.cshtml <li>@Html.ActionLink("View Reports","ViewReports","Home")</li>

控制器

  public ActionResult ViewReports()
        {
            return View("reports");
        }

Reports.cshtml <iframe src ="https://test-server/Reports"></iframe> 以下是我在MVC网站上看到SSRS的方式。有没有其他让这个工作?类似浏览器控件的东西占据了页面中的所有正文内容。

非常感谢任何帮助。谢谢 enter image description here

1 个答案:

答案 0 :(得分:0)

(由于代理问题,我无法看到您的图片。) 使用重定向:

public ActionResult ViewReports()
{
    return Redirect("https://test-server/Reports");
}