or
Hi, recently started using the free trial of Telerik Reporting in my MVC project. So what I do is, on the client side, when a button is pressed, it sends down an ID to the controller which calls GetReport to get data matching the ID, and then return a report back to the client. However, I keep getting this error <ExceptionMessage>Invalid value of report parameter 'id'.</ExceptionMessage>.
What am I doing wrong? I think I'm doing this correctly going by the resources: http://www.telerik.com/help/reporting/entitydatasource-connecting-to-entity-data-model.html
NB: int _stuffId is never null, it does have a value when I debugged the app.
// ReportRepo.cspublic Report GetReportData(int _id){ return m_context.Stuff.SingleOrDefault(c => c.StuffId == _id);}// controllerpublic HttpResponseMessage GetReport(int _stuffId){ try { EntityDataSource entityDataSource = new EntityDataSource(); entityDataSource.ObjectContext = typeof(ReportRepo); entityDataSource.ObjectContextMember = "GetReportData"; entityDataSource.Parameters.Add("_id", typeof(int), _stuffId); Report1 report1 = new Report1(); report1.DataSource = entityDataSource; ReportProcessor reportProcessor = new ReportProcessor(); InstanceReportSource instanceReportSource = new InstanceReportSource(); instanceReportSource.ReportDocument = report1; RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, null); HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); var stream = new MemoryStream(result.DocumentBytes); response.Content = new StreamContent(stream); response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); response.Content.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment"); response.Content.Headers.ContentDisposition.FileName = result.DocumentName + "." + result.Extension; return response; }}if (!string.IsNullOrEmpty(name)) { string str = ":\\/?*[]"; for (int i = 0; i < str.Length; i++) { char chr = str[i]; int num = name.IndexOf(chr); if (num >= 0) { name = name.Remove(num, 1); } } if (name.Length > 31) { name = name.Remove(31); } }using System;using Telerik.Reporting;namespace TestInheritedReport{ public class MyReport : Telerik.Reporting.Report { }}The service Telerik.Reporting.Design.Interfaces.IRootDesignerPresenter already exists in the service container. Parameter name: serviceTypeat System.ComponentModel.Design.ServiceContainer.AddService(Type serviceType, ServiceCreatorCallback callback, Boolean promote)
at System.ComponentModel.Design.ServiceContainer.AddService(Type serviceType, ServiceCreatorCallback callback)
at Telerik.Reporting.Design.VisualStudio.DependencyLoader.Initialize(IDesignerHost host)
at Telerik.Reporting.Design.ReportRootDesigner.LoadDependencies()
at Telerik.Reporting.Design.ReportRootDesigner.Initialize(IComponent component)
at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)
at System.ComponentModel.Design.DesignerHost.PerformAdd(IComponent component, String name)
at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)