none
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index SSRS 2008 R2 error in sharepoint 2010

    Question

  • Hi,

    I have a drill down report with 9 parameters which has Expand All/Collapse All as one of its parameter. On the initial rendering of the report,  I have a default selection of Expand All for the parameter which will expand the data for all the grouped rows . If I select Collapse All, the report collapses all the data and I can toggle the data manually. We have a sharepoint environment to display the reports for the users. 

    This report is working fine in BIDS, Report Builder 3.0 and Sharepoint test environment. This report is working fine in the production Sharepoint environment when "Expand All" is selected from the Expand All/Collapse All parameter. We are getting the following error only in the production sharepoint environment when we select "Collapse All" from the parameter list or try to toggle on any of the grouped data in the rows.

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

    I checked the report from production environment in report builder and it is working fine with the same selection without throwing any error. Do we need to change any settings on the production sharepoint environment or can  I fix the issue by making changes to the RDL file?

    I referred to many forums but could not find a solution to solve this problem. If anyone could please help me with this issue that would be really great and appreciated.

    Thanks,

    Rajesh.


    • Edited by Rajesh22 Friday, August 19, 2011 6:54 AM
    Friday, August 19, 2011 4:22 AM

Answers

  • Hi Rajesh22,

    Thanks for your question and ClareMoore’s replies. This issue may happen in different scenarios, regarding to your environment, I would suggest you check it from below directions.

    1. There are some invalid page layouts deployed to the master page of your report.

    Please delete them using UI, you can refer to this thread: Index was out of range. Must be non-negative and less than the size of the collection.

    2. There are images in the page header or page footer, but the footer or header is not large enough to handle the image inside it.

    Change the height of the page header or page footer. Please refer to: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index.

    3. Please try to change the parameter Toggle’s data type from Integer to Boolean and set the available values are:

    Expand All----true

    Collapse All----false

    Hope them help you. If the issue still exists, please let me know.

    Thanks,
    Sharp


    Please remember to mark the replies as answers if they help you and unmark them if they provide no help.
    Wednesday, August 24, 2011 2:48 AM
    Moderator

All replies

  • Does the data look similar in production?
    Friday, August 19, 2011 4:40 AM
  • What is the code you are using for your expand/collapse all functionality
    Friday, August 19, 2011 4:41 AM
  • Yes....It is pointing to the same database in quality and production....
    K.Rajesh
    Friday, August 19, 2011 6:48 AM
  • I have set the available value for Expand All to 1 and Collapse All to 0 and set the default value to 1 for the parameter.

    For all the row groups I have set the visibility expression to "=IIF(Parameters!Toggle.Value,false,true)" and set the "Display can be toggled by this item" to the subsequent parent group for all the row groups.

    I have the parameter name as Toggle and Prompt as Expand All/ Collapse All.


    K.Rajesh
    Friday, August 19, 2011 6:53 AM
  • Hi Rajesh22,

    Thanks for your question and ClareMoore’s replies. This issue may happen in different scenarios, regarding to your environment, I would suggest you check it from below directions.

    1. There are some invalid page layouts deployed to the master page of your report.

    Please delete them using UI, you can refer to this thread: Index was out of range. Must be non-negative and less than the size of the collection.

    2. There are images in the page header or page footer, but the footer or header is not large enough to handle the image inside it.

    Change the height of the page header or page footer. Please refer to: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index.

    3. Please try to change the parameter Toggle’s data type from Integer to Boolean and set the available values are:

    Expand All----true

    Collapse All----false

    Hope them help you. If the issue still exists, please let me know.

    Thanks,
    Sharp


    Please remember to mark the replies as answers if they help you and unmark them if they provide no help.
    Wednesday, August 24, 2011 2:48 AM
    Moderator