Saturday, April 18, 2015

RenderFormat.IsInteractive and RenderFormat.Name

Sometimes reports require branding not to be printed when exported to Excel. Since SQL Server 2008 R2 and above this can be done using the RenderFormat.IsInteractive property.

Globals!RenderFormat.IsInteractive will return true when viewing the report in preview mode or using ReportManager tool and will return false for the export formats.

It will really good to set the property if you want to

  • Use complex formatting and interactivity for on-screen display, but optimize for Excel export and post-processing with a more data oriented view.
  • Print: add/omit text disclaimers, logos, background images, etc.
  • PDF/Excel/Word: dynamically disable hyperlinks when report is exported
  • TIFF/Print: define a particular color chart palette for all rendering formats, but use an optimized grayscale palette when using TIFF for fax, or printing
  • If in your particular situation you have to make decisions based on the actual type of rendering format, you have to write your expression using the exact, case-sensitive name of the rendering extension as registered in RSReportServer.config / RSReportDesigner.config using the property Globals!RenderFormat.Name.

    Reporting Services built-in rendering extension names include: "WORD", "EXCEL", "PDF", "MHTML", "IMAGE" (includes TIFF, Print). Note that interactive viewing in preview or report manager uses the "RPL" renderer.

    Technorati Tags: ,

    No comments:

    Post a Comment