I'm using BoldReport.ASpNet.Core 2.3.39 with Asp Net Core 3.1.8.
I've followed step in documentation to create Report Viewer with ASP Net Core.
However, when I preview RDL report with image from database, image url is showing below message.
{"type":"https://tools.ietf.org/html/rfc7231#section-6.5.13","title":"Unsupported Media Type","status":415,"traceId":"|7360524d-42ced83217cd6b4a."}
image url:http://localhost:51286/api/Report/GetResource/?key=d1178e17-2eb3-4da3-8a83-7e475149735c_sf_ImageQR_76a29788-ca14-4c85-bb27-b5dfaaffe297&resourcetype=sfimg&isPrint=false
I've tried to debug GetResource function in Report api controller but it never get called.
//Get action for getting resources from the report
[ActionName("GetResource")]
[AcceptVerbs("GET")]
// Method will be called from Report Viewer client to get the image src for Image report item.
public object GetResource(ReportResource resource)
{
return ReportHelper.GetResource(resource, this, _cache);
}
After spending few hours I finally get it to work by adding '[FromQuery]'
public object GetResource([FromQuery]ReportResource resource)
{
return ReportHelper.GetResource(resource, this, _cache);
}
Hope anyone can confirm this and fix the ReportViewer ASP Net Core documentation.