Intro
The server-side OfficeWriter renderers for Reporting Services use ExcelTemplate and WordTemplate to populate the report and stream it back to the user. However, since Reporting Services does not provide runtime control, it is not possible to access the ExcelTemplate and WordTemplate APIs directly in order to set various properties.
In version 3.9.2 new functionality was added to turn on certain OfficeWriter properties by adding keys to the Reporting Services web.config. Additional properties were made available in version 8.5.0. See below for more details.
Setting the Properties
In version 3.9.2, the following properties were made available:
- UpdateIfFields and EnableNextFields in WordWriter
- PreserveStrings in ExcelWriter
In version 8.5.0 the following properties were added:
- PreserveFieldsand UnlinkIfFields in WordWriter
- RemoveExtraDataMarkersin ExcelWriter
In version 8.6.1 the following property was added:
LineBreaksToParagraphs in WordWriter
In version 9.1 the following property was added:
- ExcelTemplate.ContentType
- ExcelTemplate.EncryptPassword
- ExcelTemplate.ExcludeMacros
- ExcelTemplate.LicenseKey
- ExcelTemplate.PreserveStrings
- ExcelTemplate.StretchCellReferencesInCharts
- WordTemplate.AllowURIs
- WordTemplate.DataSourceSeparator
- WordTemplate.LicenseKey
To set these properties on the Server go to web.config located in \Reporting Services\ReportServer. Add the following code for the desired properties:
Put the code before the closing of the configuration tag, as in the image below. Make sure not to place it inside any other tag. If web.config already contains an appSettings section, add the keys to the existing section. Do not create another appSettings section.
Note: The keys are case sensitive so make sure True is capitalized. The default value of these properties is False.