RDLC Embedded Image Distorted In PDF
I have a very simple RDLC report I've built with a PNG image in the header. After many trials we could not get external images to work with the report in staging and production.
I then embedded the image in the RDLC and deployed the updated file. The image displays in the ReportViewer control fine. However, when using the export functionality of the viewer to get a PDF the image comes out garbled and distorted. It basically looks as if the image was like the Star Wars intro t开发者_如何学编程ext but repeated vertically till it disappears. This happens both on my test machine and in stage/production.
Is there something I'm not doing correctly with embedding the image? I've thought about seeing if I could MIME encode the image another way and then insert that into the RDLC. Seems stretched to work though.
Figured this out.
It does have to do with the encoding, in a way. It appears that the PNG encoding is doing weird things. I tried JPEG and GIF encodings and both work in the ReportViewer and PDF export. I tried changing to different PNGs (transparency and non-transparent) and had various distortion issues.
It is my suggestion that if using an embedded image with the ReportViewer that will be exported to PDF that you should use GIFs or JPEGs for embedding in your RDLC.
I just encountered this issue. For me, the PDF you can generate from the SSRS preview showed the PNG just fine. But when i published the report to SharePoint and then managed email subscriptions to send a PDF, that PDF showed the image all screwy (basically tilted image and then repeated vertically). In my case, I was using a PNG file that had a resolution of greater than 4000 x 4000. I resized it to something more like 1200 x 1200 and the PDF from the subscription showed the PNG just fine.
精彩评论