question

PiotrA-1612 avatar image
0 Votes"
PiotrA-1612 asked Joyzhao-MSFT answered

ReportExecution2005 HTMLFragment problem

Hi,
If you render report using ReportExecution2005.asmx Render2 method using this device info:

 <DeviceInfo>
   <Section>1</Section>
   <ActionScript>actionProxy</ActionScript>
   <HTMLFragment>True</HTMLFragment>
   <StreamRoot>streamRoot?executionId=EXECUTION_ID&amp;id=</StreamRoot>
   <ResourceStreamRoot>resourcesStreamRoot</ResourceStreamRoot>
 </DevieInfo>

And HTML4.0 format.
Then on SSRS 2017 version: 14.0.600.689 (October 2017)
The output is perfectly fine and report is rendered without issues. Images are resized and everything works.
But somewhere between that version and 14.0.600.906 something has changed and the images are no longer resized. Instead the html fragment is triggering javascript error:

 Uncaught TypeError: Cannot read properties of undefined (reading 'minWidth')
   at Microsoft_ReportingServices_HTMLRenderer_FitProportional.ResizeImage

Now if you dig a bit into the javascript that is included in rendered report you can see that this method is working only for IE, and before it's executed the method 'Microsoft_ReportingServices_HTMLRenderer_IsIE' is called, which looks like that in .689 version:

 function Microsoft_ReportingServices_HTMLRenderer_IsIE(){return document.all?!0:!1}

And in higher version (including SSRS from SQL Server 2019):

 function Microsoft_ReportingServices_HTMLRenderer_IsIE() {
     return document.all !== undefined
 }

Aside from the fact that document.all is deprecated in all browsers, all browsers support it.
But only IE supports the failing element.currentStyle.minWidth property from 'ResizeImage' method in Microsoft_ReportingServices_HTMLRenderer_FitProportional "class".

Aside from this issue, keeping in mind that HTML4.0 format is also deprecated I tried to render the fragment using HTML5 renderer but it does not resize images at all.
Images are left with css classes like "resize100width".

We are actively using this to render a lot of existing reports in a 'backoffice' type of application so we can't just switch to other forms of rendering like powerBI, and at this moment our workaround was to disable the branding images on the reports.
Another way is to just simply string replace the failing method to the old one so the rendered report knows that it's not in IE browser. But the issue comes from reporting services.
It's also very worrying that the HTML5 output does not work at all if it comes to images, and that might not be all as we didn't test the rest of stuff yet using it.

Any plans/fixes planned for that?







sql-server-reporting-services
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Joyzhao-MSFT avatar image
1 Vote"
Joyzhao-MSFT answered

Hi @PiotrA-1612 ,
Thanks for your feedback.
I recommend that please submit your issue to the Microsoft feedback at this link: https://feedback.azure.com/d365community/forum/04fe6ee0-3b25-ec11-b6e6-000d3a4f0da0. If the customer mentions the requirement multiple times, the product team may consider adding/improving this feature in the next SQL Server version. Your feedback is very valuable for us to improve our products and improve the level of service provided.
Best Regards,
Joy


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.