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&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?