Wednesday, March 21, 2012

Export a report as JPEG format

Hi,

From the Reporting Services 2005 Documentation, it mentions that a report can be rendered as a JPEG format. Here is a quote from the aritcle:

"The Image rendering extension renders a report to a bitmap or metafile. By default, the Image rendering extension produces a TIFF file of the report, which can be viewed in multiple pages. When the client receives the image, it can be displayed in an image viewer and printed.

The Image rendering extension can generate files in any of the formats supported by GDI+: BMP, EMF, GIF, JPEG, PNG, and TIFF. For TIFF format, the file name of the primary stream is ReportName.tif. For all other formats, which render as a single page per file, the file name is ReportName_Page.ext where .ext is the file extension for the chosen format."

But I only see TIFF to be the only available image format in the Render format drop down list.

Could somebody please tell me how to export a report in JPEG format?

Thank you in advance.

The image format is controlled via the deviceinfo setting on the renderer. There is no way to set this from the UI. It can only be done programatically or by direct url access.

However, you can specify default deviceinfo settings in the config file. So you could add another instance of the image renderer with a default to jpg. Add the following code to rsreportserver.config under Configuration/Extensions/Render:

<Extension Name="JPG" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.ImageReport,Microsoft.ReportingServices.ImageRendering">
<OverrideNames>
<Name Language="en-us">JPG</Name>
</OverrideNames>
<Configuration>
<DeviceInfo>
<OutputFormat>JPEG</OutputFormat>
</DeviceInfo>
</Configuration>
</Extension>

|||

Great, that works!

Thank you very much Brian for your prompt reply.

Cheers,

Peter

|||

Hi,

I tried to do the same on a Reporting Server 2000, but I do not see JPG as an option for output like it did with RS 2005. Could somebody please let me know how to achieve the same result in RS 2000?

Thank you in advance.

Peter

|||

Setting DeviceInfo values in the server config file like Brian described is available only in RS 2005.

-Chris

|||

I see there is an extension for IMAGE rendering. But IMAGE is not shown as an option from the output format drop down list.

Could you please tell me how to activate this?

Thanks.

|||

The Image rendering extension exports all of the image formats including JPEG, GIF, and TIFF. TIFF is the default. The TIFF option in the Report Manager dropdown is calling the Image rendering extension.

To get other image formats from the Image extension in RS 2000 you'll have to render by URL and specify the output format. For example:

http://localhost/reportserver/?/myreport&rs:Command=Render&rs:Format=Image&rc:OutputFormat=JPEG

-Chris

No comments:

Post a Comment