July 26, 2006 at 11:53 am
I keep getting this error when I try to generate a report using the web service.
This was working previously, until I attempted to add parameter information. Here's my code:
localhostExec2005.ReportExecutionService rs = new localhostExec2005.ReportExecutionService();
rs.Url = globalData.ReportingServicePath + "/ReportExecution2005.asmx";
System.Net.NetworkCredential nc = new System.Net.NetworkCredential("aaaaaa", "xxxxxx");
rs.Credentials = nc;
localhostExec2005.ParameterValue[] rsParams = new localhostExec2005.ParameterValue[4];
rsParams[0] = new localhostExec2005.ParameterValue();
rsParams[0].Name = "clientID";
rsParams[0].Value = "6";
rsParams[1] = new localhostExec2005.ParameterValue();
rsParams[1].Name = "fiscalYear";
rsParams[1].Value = "2004";
rsParams[2] = new localhostExec2005.ParameterValue();
rsParams[2].Name = "bID";
rsParams[2].Value = "260";
rsParams[3] = new localhostExec2005.ParameterValue();
rsParams[3].Name = "DirectCostTitle";
rsParams[3].Value = "test";
rs.SetExecutionParameters(rsParams, "en-us");
localhostExec2005.ExecutionHeader execHeader = new localhostExec2005.ExecutionHeader();
localhostExec2005.ExecutionInfo rpt = rs.LoadReport("/TestReports/TestReport01", null);
rs.ExecutionHeaderValue = execHeader;
rs.ExecutionHeaderValue.ExecutionID = rpt.ExecutionID;
string Extension = "";
string MimeType = "";
string Encoding = "";
localhostExec2005.Warning[] warnings = null;
string[] streamIDs = null;
byte[] rptStream = rs.Render("PDF", null, out Extension, out MimeType, out Encoding, out warnings, out streamIDs);
I just can't seem to find any decent documentation or examples in how to do this. Can anyone help? Thanks
July 26, 2006 at 12:44 pm
I actually discovered the problem.
The SetExecutionParameters method had to be called after the report was loaded:
localhostExec2005.ExecutionInfo rpt = rs.LoadReport("/TestReports/TestReport01", null);
rs.SetExecutionParameters(rsParams, "en-us");
Now it works fine. However, I am still somewhat unclear about what's happening here, and if anyone knows a good resource or tutorial about this, I would really appreciate it!
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply