Search code examples
sqlsql-server-2008reporting-servicesssrs-2008

Reporting Services Error?


When running a report in preview I get the following error The definition of the report is invalid , the tablix 'Tablix11' contains an invalid TablixMember. The sort Expressions element is not allowed if Group is omitted.

I have never come across this error before and cant understand what is causing it.


Solution

  • The error can be replicated by creating a simple Tablix and looking at the underlying XML.

    When you create a Tablix with a group, the underlying RDL XML will include something like this:

            <TablixRowHierarchy>
              <TablixMembers>
                <TablixMember />
                <TablixMember>
                  <Group Name="Group1">
                    <GroupExpressions>
                      <GroupExpression>=Fields!val.Value</GroupExpression>
                    </GroupExpressions>
                  </Group>
                  <SortExpressions>
                    <SortExpression>
                      <Value>=Fields!val.Value</Value>
                    </SortExpression>
                  </SortExpressions>
                  <TablixMembers>
                    <TablixMember>
                      <Group Name="Details3" />
                    </TablixMember>
                  </TablixMembers>
                </TablixMember>
              </TablixMembers>
            </TablixRowHierarchy>
    

    If you remove the entire Group element, this will give the same error you're seeing:

    enter image description here

    If you also remove the SortExpressions element this will allow the report to render without error.

    However - it's impossible for me to say how your RDL file got in this state in the first place. Given that hacking XML to get things running is seldom a good idea, my recommendation would be to start the tablix from scratch instead of hacking things to a working state - you might just be introducing more problems.

    But at least hopefully now you can see why the error might be occurring.