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

Problem rendering images

5 Answers 168 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Harsimrat
Top achievements
Rank 1
Harsimrat asked on 28 May 2019, 09:39 PM

Our Images are on Azure Blob Storage and it needs a special SAS token to access (https://docs.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1).

We generate the Url on runtime and return it to the report viewer with valid SAS (proper Url), and sometimes the images render and other times it just gives 403.

An error has occurred while processing PictureBox 'Images':
Invalid image data.
------------- InnerException -------------
The remote server returned an error: (403) Forbidden.

Even if the images render in the viewer, when we go try to generate a PDF, it always throws the above error.

Harsimrat

 

5 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 31 May 2019, 03:42 PM
Hi Harsimrat,

For the images that are not rendered correctly, I suspect that the SAS Token contains sequences of characters that are like URL encoded symbols, and our tool decodes them. For example: %2F is accepted as  "/", e.g. forward slash - check HTML URL Encoding Reference, and for that reason the exception is thrown because the link is not already the same. This is a known issue which is already resolved and the fix will be included in our Service Pack which will be released in the middle of June 2019.

As a workaround, you may implement a UserFunction which uses a custom logic to avoid this URL encoding, e.g. to take the URL to the image and resolve it to a Bitmap to be passed as a value to the PictureBox.

Regards,
Neli
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Harsimrat
Top achievements
Rank 1
answered on 31 May 2019, 07:37 PM
Thank you very much for the workaround, it worked successfully.
0
Christine
Top achievements
Rank 1
answered on 30 Nov 2020, 06:28 PM

Hello, I just wanted to follow up on this question because I upgraded to v14.2.20.1021 and would like to use the Azure Blob Storage URL with SAS token (ideally without needing a user function). My understanding was that this was fixed in a 2019 version, however I am still seeing the following error for all of my PictureBoxes:

An error has occurred while processing PictureBox 'pictureBox3':

"The remote server returned an error: (400) Bad Request".

And interestingly enough, in the Telerik Report Designer, I can view the images 100% of the time.

 

I tried the URI config changes, but it didn't make a difference. I'm using .NET Framework 4.7.2.

Any ideas?

Thanks!

Christine

 

0
Neli
Telerik team
answered on 03 Dec 2020, 04:12 PM

Hi Christine,

This seems to be an issue from the TLS version. The service is probably using a TLS 1.2 HTTPS connection. This makes sense since we have enabled this protocol in the Standalone designer. However, this should be enabled explicitly in order to connect to such secure web services. You may check the WebServiceDataSource failing to retrieve web resources on TLS 1.2 HTTPS connection KB article for details.

Please, test the approach from the KB  article and let us know if the issue is resolved.

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Christine
Top achievements
Rank 1
answered on 03 Dec 2020, 05:04 PM

Fantastic. I was able to use the fix of calling "System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12" in my override method of SendAsync of the HttpDelegator in my Telerik reporting assembly. I'm able to view all blob images using the URL.

Thanks Neli.

Tags
General Discussions
Asked by
Harsimrat
Top achievements
Rank 1
Answers by
Neli
Telerik team
Harsimrat
Top achievements
Rank 1
Christine
Top achievements
Rank 1
Share this question
or