Hello,
I am trying to use HTML5 Report Viewer with MVC extension helper.
I have an error "Unable to get report parameters: Missing report name". It is happening during POST request to /api/reports/clients/210953-ab00/parameters which gets 400 Bad Request.
I guess because request data do not have report: parameterValues: {} report: null
I call HTML helper like that:
@(Html.TelerikReporting().ReportViewer()
.Id("reportViewer1").ReportResolver(new TypeReportSourceResolver())
.ServiceUrl("/api/reports/")
.TemplateUrl(Url.Content("~/ReportViewer/templates/telerikReportViewerTemplate.html"))
.ReportSource(new InstanceReportSource(){ReportDocument = new SessionReport()})
.ViewMode(ViewModes.INTERACTIVE)
.ScaleMode(ScaleModes.SPECIFIC)
.Scale(1.0)
.PersistSession(false)
)
I have my ReportController implemented like:
public class ReportsController : ReportsControllerBase
{
protected override IReportResolver CreateReportResolver()
{
var reportsPath = HttpContext.Current.Server.MapPath("~/Reports");
return new ReportFileResolver(reportsPath)
.AddFallbackResolver(new ReportTypeResolver());
}
protected override ICache CreateCache()
{
return Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache();
}
}
And as I am using MVC5 with WepApi2 I have in my web.config following (I am not sure about last entry for Newtonsoft.Json):
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
</dependentAssembly>
Can you help, please? Regards, Yegor.
I am trying to use HTML5 Report Viewer with MVC extension helper.
I have an error "Unable to get report parameters: Missing report name". It is happening during POST request to /api/reports/clients/210953-ab00/parameters which gets 400 Bad Request.
I guess because request data do not have report: parameterValues: {} report: null
I call HTML helper like that:
@(Html.TelerikReporting().ReportViewer()
.Id("reportViewer1").ReportResolver(new TypeReportSourceResolver())
.ServiceUrl("/api/reports/")
.TemplateUrl(Url.Content("~/ReportViewer/templates/telerikReportViewerTemplate.html"))
.ReportSource(new InstanceReportSource(){ReportDocument = new SessionReport()})
.ViewMode(ViewModes.INTERACTIVE)
.ScaleMode(ScaleModes.SPECIFIC)
.Scale(1.0)
.PersistSession(false)
)
I have my ReportController implemented like:
public class ReportsController : ReportsControllerBase
{
protected override IReportResolver CreateReportResolver()
{
var reportsPath = HttpContext.Current.Server.MapPath("~/Reports");
return new ReportFileResolver(reportsPath)
.AddFallbackResolver(new ReportTypeResolver());
}
protected override ICache CreateCache()
{
return Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache();
}
}
And as I am using MVC5 with WepApi2 I have in my web.config following (I am not sure about last entry for Newtonsoft.Json):
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
</dependentAssembly>
Can you help, please? Regards, Yegor.