My SSRS Report is Failing – A Fix For Those Missing or Inconsistent Field Names in a SharePoint List Query

Posted By Posted by: EPM Partners on August 28, 2014

We’ve all had the situation where our SSRS report fails when the SharePoint list query is looking for fields that either do not exist or have different names in previous versions of the list. Sometimes, this is due to having different versions of the same SharePoint list are active across a project portfolio. Here’s a workaround for you to get that SSRS report to work even with those annoying inconsistent or missing field names:

Scenario:
Different versions of the same SharePoint list are active across a project portfolio.

Problem:
SSRS report fails if a SharePoint list query is looking for fields that either do not exist or have different names in previous versions of the list.

Solution:
Remove the ViewFields section of the CAML query.

Result:
The report will run without errors and display blank space for any unidentifiable fields. However, text will be displayed as HTML and will require the additional step of applying a routine to each textbox to display clear text.

Example:

<RSSharePointList xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema“><ListName>PCG Report Status Comments</ListName><ViewFields><FieldRef Name=”ID” />

<FieldRef Name=”ContentType” />

<FieldRef Name=”Title” />

<FieldRef Name=”Modified” />

<FieldRef Name=”Created” />

</ViewFields>

</RSSharePointList>

 

<RSSharePointList xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema“><ListName>PCG Report Status Comments</ListName></RSSharePointList>


Blog Posted In Blog Posted In: How to, SharePoint, Troubleshooting
Blog Posted In 

Leave a Reply

Your email address will not be published. Required fields are marked *