Use JPEG’s in Reporting Services if exporting to PDF

I recently made the mistake of using PNG’s for high-resolution background images in SQL Server Reporting Services (2008 R2). I wanted to use PNG’s as they were lossless, supported alpha transparency and actually generated smaller files than JPEG for the images I was using.  Unfortunately I ran into these problems when exporting to PDF:

SLOW export to PDF
PNG exported to PDF: 17 seconds.
JPEG exported to PDF: 2 seconds.
GIF’s also take the same ridiculously long amount of time as PNG’s to export to PDF.

No Alpha Transparency Support
I was initially planning to have a “DRAFT” watermark appear on the report based on a parameter.  I thought an easy way to do that would be to add a PNG with alpha transparency as an additional image object, and show/hide it as needed. This works great when exporting the report to a TIFF file, but it turns out the PDF renderer does not support transparency:

Alpha transparency exported to TIFF
Alpha transparency exported to TIFF
Alpha transparency exported to PDF
Alpha transparency exported to PDF

I finally concluded that JPEG’s are the only option if the report is going to be exported to PDF. In order to solve my DRAFT watermark issue, I ended up having to create two versions of each image, one with a draft watermark, one without.

Comments

One response to “Use JPEG’s in Reporting Services if exporting to PDF”

  1. Dave R. Avatar
    Dave R.

    Great info! I’m doing something exactly like this and it helped me a lot. Keep the great content coming!

Leave a Reply

Your email address will not be published. Required fields are marked *