【问题标题】:ASP.net MVC - Telerik Reporting error => /api/reports/clients returns "Missing report name"ASP.net MVC - Telerik 报告错误 => /api/reports/clients 返回“缺少报告名称”
【发布时间】:2013-12-12 16:37:19
【问题描述】:

我是 Telerik Reporting 的新手,并且已开始将 Report Viewer 添加到我的 ASP.net MVC 应用程序中。在运行时 ReportViewer 显示“错误请求”,Fiddler 显示在错误消息下方。

消息: 发布 /api/reports/clients/215829-979c/参数 HTTP/1.1 “缺少报告名称”

你能帮我解决这个问题吗?

报告查看器代码sn-p:

Html.TelerikReporting().ReportViewer()
                   .Id("reportViewer1")
                   .ServiceUrl("/api/reports")
                   .TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate.html")
                   .ReportSource(Model.ReportSource)
                   .ViewMode(ViewModes.INTERACTIVE)
                   .ScaleMode(ScaleModes.SPECIFIC)
                   .Scale(1.0)                   

谢谢你 -nm

【问题讨论】:

    标签: asp.net-mvc telerik reportviewer


    【解决方案1】:

    我不确定您是如何从控制器传递报告的,因为该代码不在您的帖子中,但您可能希望通过直接引用报告的程序集名称来解决问题(将“应用程序”替换为您的根命名空间):

    @{
    var typeReportSource = new TypeReportSource() { TypeName = "Application.Reports.Report1, Application" };
    }
    @(
    Html.TelerikReporting().ReportViewer()
       .Id("reportViewer1")
       .ServiceUrl("/api/reports/")
       .TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate.html")
       .ReportSource(typeReportSource)
       .ViewMode(ViewModes.PRINT_PREVIEW)
       .ScaleMode(ScaleModes.SPECIFIC)
       .Scale(1.0)
       .PersistSession(true)
    )
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-30
      • 2019-06-08
      • 1970-01-01
      相关资源
      最近更新 更多