Unable to Print Reports from Azure Environment
|Product||Progress® Telerik® Reporting|
|Project Type||Desktop Application|
Azure websites restrict the usage of certain GDI APIs we use for image rendering. When working with a desktop client (WinForms or WPF report viewer), the printing process essentially is rendering the report using the ImageRendering extension in a Metafile. We use Metafile, because it is a vector format, hence supports scaling/zooming without quality loss. However, metafiles are not supported in Azure.
In R2 2018 Service Pack 1 (126.96.36.1990) we introduced an extended configuration especially for printing in raster files. The name of the rendering extension is ImagePrint and it can be set up to render in TIFF, PNG, JPEG or BMP when printing, instead of using metafile (EMF). The configuration section should look like as following:
<Telerik.Reporting> <extensions> <render> <extension name="IMAGEPrint"> <parameters> <parameter name="OutputFormat" value="PNG"/> </parameters> </extension> </render> </extensions> </Telerik.Reporting>
This setting will be respected when initiating printing from a WPF or WinForms viewer and the image, generated for printing, will be rendered in a Bitmap instead of Metafile. So, the approach will work, since Bitmaps are supported in Azure.
Please consider that the default resolution of printed image is 96 DPI. If the image appears pixelated when printed, try increase the resolution, setting the parameters DpiX and DpiY of ImagePrint extension. You can read more about the available extension settings in Image Device Information Settings help article.