title: How to determine value of MaxHttpCollectionKeys for an SSRS 2008 report?
body: <p>As per <a href="http://support.microsoft.com/kb/2661403" rel="nofollow">http://support.microsoft.com/kb/2661403</a>, recent Windows Updates rolling out Microsoft Security Bulletin MS11-100 have set the default of MaxHttpCollectionKeys to 1000.  This has caused some issues with some of my company's SSRS 2008 reports.  While it is easy to simply use a higher value in order to get the reports to work I would like to know a bit more about how this works.  I understand this particular setting is HTTP thing, not strictly an SSRS thing, but this SSRS is the context of my investigation.  My aim is to derive some sort of way to calculate what the value for MaxHTTPCollectionKeys should be to cater for my reports, obviously looking at the worst case report which will have the greatest number of possible parameter values.</p>
  
  <p>So my main question is this - with respect to an SSRS report, what constitutes an item that is counted and compared to the setting MaxHTTPCollectionKeys?  Obviously there is some correlation to the total number of values from all parameters for a report, but how does this work exactly?</p>
  
  <p>I have made some test reports (using VS2008) and run them on my local 2008 R2 report server and found that the value of MaxHTTPCollectionKeys does not match exactly with the total number of parameter values passed at run-time.  One of my test reports contained only one multi-valued parameter of type INTEGER for which I defined a list of allowable values - ints 1 - 10.  I set the value for MaxHTTPCollectionKeys = 35 (in the report manager web config file.  Note - i reset the report server before performing my tests) and found that the report would run when i select six values (1 - 6, 2 - 7 - any combination of six) but not 7.  This suggests that 29 items are included in the collection before grabbing parameter values.  Further, I set MaxHTTPCollectionKeys = 30 and found that I could only select a single value for the parameter for the report to run.  When i set MaxHTTPCollectionKeys = 29 I could not run the report at all (multi-value parameters cannot be null).</p>
  
  <p>I then changed the report and found that by adding a second parameter (basically a copy of the first, multi-value int type with a list of ten ints) the base number rose from 29 to 30.  That is, when i set MaxHTTPCollectionKeys = 35 i could only select a total of five values between my two parameters (various combinations of the amount of items for each parameter didn't affect anything).</p>
  
  <p>I made a 3rd test report with no parameters at all (all the report contained was textbox which displayed the current time) and found that when MaxHTTPCollectionKeys = 27 the report worked when it was 26 it did not work.</p>
  
  <p>To reiterate, my aim is to derive some sort of way to calculate what the value for MaxHTTPCollectionKeys should be to cater for my reports, obviously looking at the worst case report which will have the greatest number of possible parameter values.  Can anybody offer some guidelines to calculate this?</p>
  
  <p>Thanks to all</p>