1

I have upgraded a rdl file from 2005 to 2012 using visual studio 2012 ultimate and I am getting an error that I did not receive in the 2005 version. The error is:

Index was out of range. Must be non-negative and less than the size
of the collection.  Parameter Name: Index

First - the RDL file does not have a parameter called "Index".

Second - I only get the error when the queried data set has no rows. For example, the report has a code parameter the user selects from a drop down. Code 661 and 663 return data sets with several hundred rows. However, 662 returns an empty data set and I receive the error.

Third - My 2005 version of this report displays a blank page with no data (the desired result) when 662 or other empty data sets are run. No errors occur in the old version and it is pointing to the same data set as the newly converted version.

I believe the culprit is the Tablix object that adds columns when rendering with a query that returns rows.

Has anyone experienced this issue when upgrading rdl files and is there a way to trouble shoot or work around the problem?

My code for one of my Tablix objects is below

      <Tablix Name="matrix3">
        <TablixCorner>
          <TablixCornerRows>
            <TablixCornerRow>
              <TablixCornerCell>
                <CellContents>
                  <Tablix Name="matrix4">
                    <TablixCorner>
                      <TablixCornerRows>
                        <TablixCornerRow>
                          <TablixCornerCell>
                            <CellContents>
                              <Textbox Name="textbox18">
                                <CanGrow>true</CanGrow>
                                <KeepTogether>true</KeepTogether>
                                <Paragraphs>
                                  <Paragraph>
                                    <TextRuns>
                                      <TextRun>
                                        <Value />
                                        <Style />
                                      </TextRun>
                                    </TextRuns>
                                    <Style />
                                  </Paragraph>
                                </Paragraphs>
                                <ZIndex>3</ZIndex>
                                <Style>
                                  <PaddingLeft>2pt</PaddingLeft>
                                  <PaddingRight>2pt</PaddingRight>
                                  <PaddingTop>2pt</PaddingTop>
                                  <PaddingBottom>2pt</PaddingBottom>
                                </Style>
                              </Textbox>
                            </CellContents>
                          </TablixCornerCell>
                        </TablixCornerRow>
                      </TablixCornerRows>
                    </TablixCorner>
                    <TablixBody>
                      <TablixColumns>
                        <TablixColumn>
                          <Width>0.59375in</Width>
                        </TablixColumn>
                      </TablixColumns>
                      <TablixRows>
                        <TablixRow>
                          <Height>0.39773in</Height>
                          <TablixCells>
                            <TablixCell>
                              <CellContents>
                                <Textbox Name="textbox19">
                                  <CanGrow>true</CanGrow>
                                  <KeepTogether>true</KeepTogether>
                                  <Paragraphs>
                                    <Paragraph>
                                      <TextRuns>
                                        <TextRun>
                                          <Value />
                                          <Style />
                                        </TextRun>
                                      </TextRuns>
                                      <Style />
                                    </Paragraph>
                                  </Paragraphs>
                                  <Style>
                                    <PaddingLeft>2pt</PaddingLeft>
                                    <PaddingRight>2pt</PaddingRight>
                                    <PaddingTop>2pt</PaddingTop>
                                    <PaddingBottom>2pt</PaddingBottom>
                                  </Style>
                                </Textbox>
                              </CellContents>
                              <DataElementOutput>Output</DataElementOutput>
                            </TablixCell>
                          </TablixCells>
                        </TablixRow>
                      </TablixRows>
                    </TablixBody>
                    <TablixColumnHierarchy>
                      <TablixMembers>
                        <TablixMember>
                          <Group Name="matrix4_ColumnGroup1">
                            <GroupExpressions>
                              <GroupExpression />
                            </GroupExpressions>
                          </Group>
                          <TablixHeader>
                            <Size>0.23864in</Size>
                            <CellContents>
                              <Textbox Name="textbox17">
                                <CanGrow>true</CanGrow>
                                <KeepTogether>true</KeepTogether>
                                <Paragraphs>
                                  <Paragraph>
                                    <TextRuns>
                                      <TextRun>
                                        <Value />
                                        <Style />
                                      </TextRun>
                                    </TextRuns>
                                    <Style />
                                  </Paragraph>
                                </Paragraphs>
                                <ZIndex>2</ZIndex>
                                <Style>
                                  <PaddingLeft>2pt</PaddingLeft>
                                  <PaddingRight>2pt</PaddingRight>
                                  <PaddingTop>2pt</PaddingTop>
                                  <PaddingBottom>2pt</PaddingBottom>
                                </Style>
                              </Textbox>
                            </CellContents>
                          </TablixHeader>
                          <DataElementOutput>Output</DataElementOutput>
                          <KeepTogether>true</KeepTogether>
                        </TablixMember>
                      </TablixMembers>
                    </TablixColumnHierarchy>
                    <TablixRowHierarchy>
                      <TablixMembers>
                        <TablixMember>
                          <Group Name="matrix4_RowGroup1">
                            <GroupExpressions>
                              <GroupExpression />
                            </GroupExpressions>
                          </Group>
                          <TablixHeader>
                            <Size>1.78125in</Size>
                            <CellContents>
                              <Textbox Name="textbox16">
                                <CanGrow>true</CanGrow>
                                <KeepTogether>true</KeepTogether>
                                <Paragraphs>
                                  <Paragraph>
                                    <TextRuns>
                                      <TextRun>
                                        <Value />
                                        <Style>
                                          <FontWeight>Bold</FontWeight>
                                          <TextDecoration>Underline</TextDecoration>
                                          <Color>RoyalBlue</Color>
                                        </Style>
                                      </TextRun>
                                    </TextRuns>
                                    <Style />
                                  </Paragraph>
                                </Paragraphs>
                                <ZIndex>1</ZIndex>
                                <Style>
                                  <PaddingLeft>2pt</PaddingLeft>
                                  <PaddingRight>2pt</PaddingRight>
                                  <PaddingTop>2pt</PaddingTop>
                                  <PaddingBottom>2pt</PaddingBottom>
                                </Style>
                              </Textbox>
                            </CellContents>
                          </TablixHeader>
                          <DataElementOutput>Output</DataElementOutput>
                          <KeepTogether>true</KeepTogether>
                        </TablixMember>
                      </TablixMembers>
                    </TablixRowHierarchy>
                    <RepeatColumnHeaders>true</RepeatColumnHeaders>
                    <RepeatRowHeaders>true</RepeatRowHeaders>
                    <ZIndex>9</ZIndex>
                    <Style>
                      <Border>
                        <Style>Solid</Style>
                      </Border>
                    </Style>
                  </Tablix>
bsivel
  • 2,821
  • 5
  • 25
  • 32
  • 1
    Remove the Tablix. Run the report. Do you still get the same error? – kyzen May 22 '14 at 19:45
  • I got a different error. Textbox70 has a repeat width value of matrix3 which was deleted. Once I remove this property it works with matrix objects removed. – bsivel May 22 '14 at 20:22
  • I then put all matrix objects back in and this resolved the error. Thanks for pointing me in the right direction! +1 – bsivel May 22 '14 at 20:32
  • 1
    Excellent! You'll find when updating old 2005 RDLs, some properties can get messed up in translation - I've seen object heights get set to 0, class paths appended to vbscript functions... all sorts of goodies. Oftentimes easiest to just start removing objects one by one til you find which one broke, – kyzen May 22 '14 at 20:35

1 Answers1

3

The most likely culprit with this error is an image in your header which is causing the HTML renderer to choke. It occurs in SSRS 2005 reports that get upgraded. The PDF and Excel renderers will probably still work fine.

Note that the image will look fine in your report - it won't have anything about it that looks wrong. However, re-position the image in your header and it will fix the error.

Chris Latta
  • 20,316
  • 4
  • 62
  • 70
  • Thanks CL _ I'll keep this info in mind; I have a bunch on rdls to upgrade. This case was due to the Repeat Width property on one of my text boxes (see my comments below question) that was set to a matrix object. 2005 handles this fine with empty record sets but 2012 chokes on it. – bsivel May 23 '14 at 13:22