/// <remarks/> public void SetExecutionParameters2Async(ParameterValue[] Parameters, string ParameterLanguage, object userState) { if ((this.SetExecutionParameters2OperationCompleted == null)) { this.SetExecutionParameters2OperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetExecutionParameters2OperationCompleted); } this.InvokeAsync("SetExecutionParameters2", new object[] { Parameters, ParameterLanguage}, this.SetExecutionParameters2OperationCompleted, userState); }
public ExecutionInfo2 SetExecutionParameters2(ParameterValue[] Parameters, string ParameterLanguage) { object[] results = this.Invoke("SetExecutionParameters2", new object[] { Parameters, ParameterLanguage}); return ((ExecutionInfo2)(results[0])); }
/// <remarks/> public void SetExecutionParameters2Async(ParameterValue[] Parameters, string ParameterLanguage) { this.SetExecutionParameters2Async(Parameters, ParameterLanguage, null); }
/// <summary> /// 其他运营部门 /// </summary> /// <param name="mTitle"></param> /// <param name="mReportid"></param> /// <param name="mYear"></param> /// <param name="mMonth"></param> /// <param name="tablenames"></param> public void OutPutOtherBusinessReport(string mTitle, string mHotelId, string mYear, string mMonth, string tablenames) { //根据hotelid ,返回report id string mReportid = string.Empty; switch (mHotelId) { case "1": mReportid = "14"; break; case "2": mReportid = "20014"; break; case "3": mReportid = "30014"; break; } ReportExecutionService rs = new ReportExecutionService(); //rs.Credentials = System.Net.CredentialCache.DefaultCredentials; rs.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials; rs.PreAuthenticate = true; rs.Credentials = new NetworkCredential("jmadmin", "klm9ab43", "JINMAO_GROUP"); rs.Url = "http://172.16.209.76/reportserver/ReportExecution2005.asmx"; // Render arguments byte[] result = null; string reportPath = "/JMHotels/OtherBusinessReport"; //string format = "MHTML"; string format = "EXCEL"; string historyID = null; string devInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>"; ParameterValue[] parameters = new ParameterValue[4]; parameters[0] = new ParameterValue(); parameters[0].Name = "title"; parameters[0].Value = mTitle; parameters[1] = new ParameterValue(); parameters[1].Name = "reportid"; parameters[1].Value = mReportid; parameters[2] = new ParameterValue(); parameters[2].Name = "year"; parameters[2].Value = mYear; parameters[3] = new ParameterValue(); parameters[3].Name = "month"; parameters[3].Value = mMonth; string encoding; string mimeType; string extension; Warning[] warnings = null; string[] streamIDs = null; ExecutionInfo execInfo = new ExecutionInfo(); ExecutionHeader execHeader = new ExecutionHeader(); rs.ExecutionHeaderValue = execHeader; execInfo = rs.LoadReport(reportPath, historyID); rs.SetExecutionParameters(parameters, "en-us"); String SessionId = rs.ExecutionHeaderValue.ExecutionID; try { result = rs.Render(format, devInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs); execInfo = rs.GetExecutionInfo(); } catch (SoapException ex) { throw ex; } // Write the contents of the report to an excel file. try { FileStream stream = File.Create(@"c:\jmreport_download\其他运营部门.xls", result.Length); stream.Write(result, 0, result.Length); stream.Close(); } catch (Exception e) { throw e; } }