Showing posts with label GIF. Show all posts
Showing posts with label GIF. Show all posts

Tuesday, January 16, 2018

SSRS Report Rendering GIF and PNG Format

This is a historical post so I don't forget how to turn this on in MS Reporting Services.  Hopefully, it helps others too as it isn't immediately obvious (like everything Microsoft makes, I suppose).

Anyway, to turn GIF and PNG rendering on in SSRS:
  1. Edit the file:

    {Reporting Path}/rsreportserver.config
  2. Which happens to be this on the server I'm working on:

    C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServ\rsreportserver.config
  3. Now, search for the tag <render> within this XML file.
  4. Add the following rendering options within this <render> element:
<Extension Name="PNG" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRenderer,Microsoft.ReportingServices.ImageRendering">
                <Configuration>
                    <DeviceInfo>
                        <ColorDepth>24</ColorDepth>
                        <OutputFormat>PNG</OutputFormat>
                    </DeviceInfo>
                </Configuration>
            </Extension>
<Extension Name="GIF" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRenderer,Microsoft.ReportingServices.ImageRendering">
                <Configuration>
                    <DeviceInfo>
                        <ColorDepth>32</ColorDepth>
                        <OutputFormat>GIF</OutputFormat>
                    </DeviceInfo>
                </Configuration>
            </Extension>

You should be all set. SSRS will pick up the change immediately, and it will be an available output rendering format.

As a bonus, you can add this to your automatic Reporting Services web service, by sending in this device info string:

@"<DeviceInfo><StartPage>{0}</StartPage><EndPage>{1}</EndPage><OutputFormat>PNG</OutputFormat></DeviceInfo>"

Maybe I'll do another blog on how to use Reporting Service's Web Service to render reports in code.  When I do, I'll link to it here.