SSRS Deserialization Failed Issue

21 Nov
November 21, 2011

I’ve ran into this wee SSRS issue today, a quick fix mind you, but I thought its worth mentioning.

The issue is in-relation to the error message: Deserialization failed: The ‘DataType’ attribute is not declared. Line X, position Y.

This issue surfaces when migrating SSRS reports to a newer version, in my case it was from SQL Server 2008 to SQL Server 2008 R2, although it has been noted when migrating to other versions of SSRS. Also, interestingly enough, if you were building the SSRS reports from scratch (i.e. using the XML schema to build the report), then you will run into the same issue if you used the DataType attribute on your parameters (even though the DataType attribute is a valid XML element as defined by the SSRS report schema).

Anyway the error generally happens on your report parameters, specifically on Integer DataTypes (either as part of the Available Values or Default Values of a parameter). The way to solve this issue is by editing the SSRS .RDL file manually yourself, either through visual studio using the Edit Code button which comes up with the issue (picture below) or through your favourite XML editor.

ssrs deserialization failed error

If you go to the line number where the error has indicated, you will find an XML that looks like this:

<ReportParameters>
    <ReportParameter Name="DaysBack">
      <DataType>Integer</DataType>
      <Prompt>DaysBack</Prompt>
      <ValidValues>
        <ParameterValues>
          <ParameterValue>
            <Value DataType="Integer">7</Value>
            <Label>7</Label>
          </ParameterValue>
          <ParameterValue>
            <Value DataType="Integer">10</Value>
            <Label>10</Label>
          </ParameterValue>
          <ParameterValue>
            <Value DataType="Integer">20</Value>
            <Label>20</Label>
          </ParameterValue>
          <ParameterValue>
            <Value DataType="Integer">30</Value>
            <Label>30</Label>
          </ParameterValue>
        </ParameterValues>
      </ValidValues>
    </ReportParameter>
  </ReportParameters>

All you really need to do is remove the DataType=”Integer” attribute from the Value tag, and everything should work fine. I recommend rebuilding the report after you have done that just to make sure everything went down well.

Hope this helps!

          0 votes
2 replies
  1. Guillermo says:

    I know this is an old problem, but I just face the same problem, I removed the “Data Type” too and worked very well, but I realize something, the parameter that fails, have the same attribute “Prompt” than another in the report, then I change one of the attributes, I close the solution, open it again and the parameter has not changed and everything works fine, so I guess the editor is mistaken in some way and that’s what happens if someone happens the same could try and let me know the outcome, remember that in any case have to remove the “DataType” extra.

    Reply
  2. Karthik says:

    This worked , thanks much for post . +1 like :)

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply to Guillermo Cancel reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>