Reporting Services Error: The following bookmark cannnot be found in the template

Problem

When rendering an OfficeWriter for Word Reporting Services report, after removing all bookmarks from the template for a specific data source, the following error occurs:

Reporting Services Error ---------------------------------------------------------- An error occurred during rendering of the report. (rrRenderingError) Get Online Help An error occurred during rendering of the report. WordWriter Error: The following bookmark can't be found in the template: DataSourceName The following bookmark can't be found in the template: DataSourceName -------------------------------------------------------------------------------- SQL Server Reporting Services 

For example, someone may decide to remove a table of data from their report which they no longer want to display. To do this, they would delete the table, thereby removing the merge fields in it and the bookmark around the table row that defined the Selection Query Range for that data source.

Solution

As mentioned above, this error occurs when a Selection Query Range is defined for a data source and then removed from the template. Once a Selection Query Range for a data source is added to the template using the OfficeWriter Designer toolbar, a bookmark is added to the template to define what portion of the document should repeat and that data source is linked to the template in the report’s RDL file. If all the bookmarks for this data source are then removed from the template, the references to that data source in the RDL file that the Designer added are not automatically removed.

This behavior is planned to change in a future version, so that it will be possible to define a Selection Query Range for a data source in a template, and then later decide to remove it. In the meantime, there are two workarounds to this issue:

Remove the relevant block from the RDL for the data source that is no longer used

Important: Back up your RDL file before making manual changes to it in case you make a mistake.

For each data source used in the template, the OfficeWriter Designer adds a DataSourceName">... block in the RDL file.

If a data source is no longer used in the template, simply open the RDL file in a text editor and remove the correspoding Table block.

For example, if you want to remove this block for a data source called Contacts, look for the ... block and delete it.

Design your report from scratch

Build a new report from scratch (both RDL and Word template). When designing the template, be careful to only add Selection Query Ranges for data sources that will definitely be used in the report. (Don’t plan on removing all the bookmarks for any data source.)

Related posts: