This is a migrated thread and some comments may be shown as answers.

Unable to add reportview to MVC app

1 Answer 546 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 28 Jul 2014, 05:45 PM
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.

1 Answer, 1 is accepted

Sort by
0
Bob
Top achievements
Rank 1
answered on 29 Jul 2014, 08:01 PM
I found my mistake.  Have to set CopyLocal property to true *and* rebuild the solution to get rid of the errors.
Tags
General Discussions
Asked by
Bob
Top achievements
Rank 1
Answers by
Bob
Top achievements
Rank 1
Share this question
or