/// <summary> /// step 4 /// </summary> /// <param name="result"></param> protected void GetPageNumber(ReportRequest rRequest, ref ReportExecuteResult result) { try { Versions.TryGetValue(this.ReportSettings.ReportServer, out Version version); if (version.Major <= SuportExportVersion) { var request = new GetExecutionInfo2Request(); var response = ReportClient.GetExecutionInfo2Async(request).GetAwaiter().GetResult(); result.PageCount = response.executionInfo.NumPages; result.PageIndex = rRequest.PageIndex; result.SessionId = rRequest.SessionId = ReportClient.ExecutionHeader.ExecutionID = response.executionInfo.ExecutionID; } else { var request = new GetExecutionInfo3Request(); var response = ReportClient.GetExecutionInfo3Async(request).GetAwaiter().GetResult(); result.PageCount = response.executionInfo.NumPages; result.PageIndex = rRequest.PageIndex; result.SessionId = rRequest.SessionId = ReportClient.ExecutionHeader.ExecutionID = response.executionInfo.ExecutionID; } } catch (Exception ex) { throw new ReportException("GetPageNumber error: " + ex.Message, ex); } }
public System.Threading.Tasks.Task <GetExecutionInfo2Response> GetExecutionInfo2Async(GetExecutionInfo2Request request) { return(base.Channel.GetExecutionInfo2Async(request)); }