Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Reporting Services Web Service parameter error

Avatar of conzoman
conzoman asked on
1 Comment1 Solution276 ViewsLast Modified:
I'm calling the following code from the onClick of a linkbutton

                        ReportingService rs = new ReportingService();
                  rs.Credentials = new System.Net.NetworkCredential("myUser", "myPassword", "myDomain");
                  byte[] result = null;
                  string reportPath = "/MoistSoil/ManagmentActivity";
                  string format = "PDF";
                  string historyID = null;
                  string devInfo = "<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
                  ParameterValue[] parameters = new ParameterValue[0];
Line 189            parameters[0] = new ParameterValue();
                  parameters[0].Name = "impID";
                  parameters[0].Value = "101";
                  DataSourceCredentials[] credentials = null;
                  string showHideToggle = null;
                  string encoding;
                  string mimeType;
                  Warning[] warnings = null;
                  ParameterValue[] reportHistoryParameters = null;
                  string[] streamIDs = null;
                  SessionHeader sh = new SessionHeader();
                  rs.SessionHeaderValue = sh;
                  result = rs.Render(reportPath, format, historyID, devInfo, parameters, credentials,
                        showHideToggle, out encoding, out mimeType, out reportHistoryParameters, out warnings,
                        out streamIDs);
                  Response.AppendHeader("content-length", result.Length.ToString());
                  Response.ContentType = "application/pdf";

At runtime I get the following error on line 189:

 Index was outside the bounds of the array.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

Avatar of kprestage

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answers