Starting in 2019, the Reporting control is no longer included in Essential Studio®. If you're experiencing issues with the Syncfusion� Reporting Platform, Report Viewer, Report Designer, or Report Writer, we recommend migrating to Bold Reports, our dedicated reporting platform.

Bold Reports offers a comprehensive suite of tools and features for all your reporting needs, and we will help you make a smooth transition from the discontinued control. Our support team at https://support.boldreports.com/ is here to assist you with any questions or difficulties you may encounter during the migration process.

We thank you for choosing Syncfusion� and appreciate your understanding.

ReportViewer failed to load image from database.

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.


3 Replies 1 reply marked as answer

MS Mahendran Shanmugam Syncfusion Team October 5, 2020 01:52 PM UTC

Hi RWEM, 

The mentioned issue occurs when using the APIController attribute in controller class file. So could you please remove the APIController as shown in below help documentation to avoiding the mentioned problem at your end. 

Regards, 
Mahendran S. 


Marked as answer

GA Gaurang February 18, 2022 04:17 PM UTC

Hi 

I am facing same issue, the URL

https://help.boldreports.com/embedded-reporting-tools/how-to/resolve-unsupported-media-type-error-on-loading-image-in-asp.net-core/

is removed. Please post the solution here so we can read and understand.

Thanks and regards.



MR Manoranjan Rajendran Syncfusion Team February 18, 2022 08:05 PM UTC


Loader.
Up arrow icon