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

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
  • Easy quick solution (or at least something to try):

    Go into your file system and find your report's .rdl file. DELETE the corresponding .rdl.data file. Now back to your IDE, do a Rebuild solution, and your problem should go away.

    This solution applies to when previewing your report was working just fine and all of a sudden you started encountering this error. It has to do with your datasets changing but the IDE failing to update the .rdl.data file for your project. This solution forces a refresh on it.

    • Proposed as answer by jasperjones999 Wednesday, November 09, 2016 1:38 PM
    • Unproposed as answer by jasperjones999 Wednesday, November 09, 2016 1:38 PM
    Monday, October 24, 2016 2:37 PM
  • there is no "corresponding .rdl.data file"

    can we all please be specific about which version of MS tools we are using?

    as I understand SSRS has 2 main versions

    1, stand alone

    2, ssrs as embedded into a asp web app

    Most of the "help" on the web is un-specific about which has what problems, this just adds another layer of complexity to a suite of products that, lets be honest, are among the least productive in the world.

    just some examples : ssrs as embedded in asp application, NO error message when a parameter is missing

    let me repeat as we have all grown accustomed to ZERO FEEDBACK from MS, NO error message

    in which world is that ever acceptable, then just repeat that for each ssis module, sql, and ssrs oh and ssas

    Talend will rule the world.



    Wednesday, November 09, 2016 1:43 PM
  • getting back to the error the op asked

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

    Mine was caused when I changed my dataset, because

    in ssrs (web app version) a chart report MS in their wisdom did not include the ability to change a data source, the data source gets added when a dataset is added.

    Then when the data source is deleted the connection internally to the data set is broken, it was at this point i got the above error.

    points to note:

    NO error on compile - wtf !

    NO error about which index which line cant get the index on which object in the report

    not even the very very useful, I will open the file in XML for you so you can have a look through in this friendly format.

    FAIL FAIL FAIL

    solution simply re-write your report from scratch but dont forget to PICK a different tool.

    Wednesday, November 09, 2016 1:52 PM