Unable to add reportview to MVC app

2 posts, 0 answers
  1. Bob
    Bob avatar
    10 posts
    Member since:
    Jul 2010

    Posted 28 Jul 2014 Link to this post

    Following the instructions on this page:

    http://www.telerik.com/help/reporting/mvc-report-viewer-extension-embedding.html

    I am unable to add the reportviewer to a view.  Here is the code and the error:

    @(Html.TelerikReporting().ReportViewer()
           .Id("reportViewer1")
           .ServiceUrl("/api/reports/")
           .TemplateUrl("/ReportViewer/templates/telerikReportViewerTemplate.htmll")
           .ReportSource(new UriReportSource() { Uri = "Product Catalog.trdx" })
           .ViewMode(ViewModes.INTERACTIVE)
           .ScaleMode(ScaleModes.SPECIFIC)
           .Scale(1.0)
           .PersistSession(false)
           )

    Error 1 'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'TelerikReporting' and no extension method 'TelerikReporting' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?) c:\VS2012Apps\FastTrack2\FastTrack.MVC\Views\Reports\Index.cshtml 26 8 FastTrack.MVC

    I have verified that the references have been added and the namespaces have been added to the web.config file.  This is a trial version of reporting version Q2 2014 8.1.14.618.  The project is MVC 4, .net framework 4.5.  I have cleaned/rebuilt/deleted obj directories, but nothing eliminates that error as well as these additional errors (which I'm sure are related:

    Error 2 The type or namespace name 'UriReportSource' could not be found (are you missing a using directive or an assembly reference?) c:\VS2012Apps\FastTrack2\FastTrack.MVC\Views\Reports\Index.cshtml 30 26 FastTrack.MVC

    Error 3 The name 'ViewModes' does not exist in the current context c:\VS2012Apps\FastTrack2\FastTrack.MVC\Views\Reports\Index.cshtml 31 18 FastTrack.MVC

    Error 4 The name 'ScaleModes' does not exist in the current context c:\VS2012Apps\FastTrack2\FastTrack.MVC\Views\Reports\Index.cshtml 32 19 FastTrack.MVC


    Any help would be appreciated.
  2. Bob
    Bob avatar
    10 posts
    Member since:
    Jul 2010

    Posted 29 Jul 2014 Link to this post

    I found my mistake.  Have to set CopyLocal property to true *and* rebuild the solution to get rid of the errors.
Back to Top