Monday, November 8, 2010

Deserialization failed: The 'DataType' attribute is not declared

I faced the above problem when I tried to open a report in Visual Studio 2008. I had edited the report many times in the past and I don’t know what caused the problem. In my opinion it must be a bug of the report builder of Visual Studio 2008. I opened the xml definition of the report and compared it with a version of the report witch was working. The difference can be found below.

Working xml

      <ValidValues>
        <ParameterValues>
          <ParameterValue>
            <Value>-1</Value>
            <Label>Less Than</Label>
          </ParameterValue>
          <ParameterValue>
            <Value>0</Value>
            <Label>Equal</Label>
          </ParameterValue>
          <ParameterValue>
            <Value>1Value>
            <Label>Greater Than</Label>
          </ParameterValue>
        </ParameterValues>
      </ValidValues>

Not working xml

      <ValidValues>
        <ParameterValues>
          <ParameterValue>
            <Value DataType="Integer">-1</Value>
            <Label>Less Than</Label>
          </ParameterValue>
          <ParameterValue>
            <Value DataType="Integer">0</Value>
            <Label>Equal</Label>
          </ParameterValue>
          <ParameterValue>
            <Value DataType="Integer">1</Value>
            <Label>Greater Than</Label>
          </ParameterValue>
        </ParameterValues>
      </ValidValues>


I removed the DataType attribute and everything worked fine

1 comment:

  1. THANKS a lot I removed :

    DataType="Integer"

    tag and it worked !!!!

    really thanks

    ReplyDelete