Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
cedubose
Starting Member
22 Posts |
Posted - 2006-07-26 : 13:45:50
|
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? ThanksHere is the full error:System.Web.Services.Protocols.SoapException: The session identifier is missing. A session identifier is required for this operation. ---> Microsoft.ReportingServices.Diagnostics.Utilities.MissingSessionIdException: The session identifier is missing. A session identifier is required for this operation. at Microsoft.ReportingServices.WebServer.SessionStarterAction.CreateExisting() at Microsoft.ReportingServices.WebServer.ReportExecutionService.SetExecutionParameters(ParameterValue[] Parameters, String ParameterLanguage, ExecutionInfo& executionInfo) --- End of inner exception stack trace --- at Microsoft.ReportingServices.WebServer.ReportExecutionService.SetExecutionParameters(ParameterValue[] Parameters, String ParameterLanguage, ExecutionInfo& executionInfo)Cynthia |
|
cedubose
Starting Member
22 Posts |
Posted - 2006-07-26 : 14:41:31
|
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!Cynthia |
 |
|
|
|
|
|
|