private void UpdatedExecutionInfoIfNecessary()
 {
     if (!m_executionInfo.HasSnapshot || m_executionInfo.NeedsProcessing || PageCountMode != 0)
     {
         m_executionInfo = Service.GetExecutionInfo();
     }
 }
 internal override void EnsureExecutionSession()
 {
     if (m_executionInfo != null)
     {
         return;
     }
     if (m_executionID == null)
     {
         string text = HistoryId;
         if (text != null && text.Length == 0)
         {
             text = null;
         }
         string reportPath = ReportPath;
         if (reportPath == null || reportPath.Length == 0)
         {
             throw new MissingReportSourceException();
         }
         if (string.IsNullOrEmpty(ReportServerUrl.ToString()))
         {
             throw new MissingReportServerUrlException();
         }
         m_executionInfo = Service.LoadReport(reportPath, text);
         m_executionID   = m_executionInfo.ExecutionID;
         OnExecutionIDChanged();
     }
     else
     {
         Service.SetExecutionId(m_executionID);
         m_executionInfo = Service.GetExecutionInfo();
     }
 }
 private ServerReport(ServerReport parentReport, ExecutionInfo executionInfo)
     : this(parentReport)
 {
     m_reportPath           = executionInfo.ReportPath;
     m_executionID          = executionInfo.ExecutionID;
     m_executionInfo        = executionInfo;
     m_trustedUserHeader    = parentReport.TrustedUserHeaderValue;
     base.DrillthroughDepth = parentReport.DrillthroughDepth + 1;
 }
 public override void Refresh()
 {
     lock (m_syncObject)
     {
         if (IsReadyForConnection && m_executionID != null)
         {
             m_executionInfo = Service.ResetExecution();
             OnChange(isRefreshOnly: true);
         }
     }
 }
 private void ClearSession(bool doRefresh)
 {
     m_executionID = null;
     OnExecutionIDChanged();
     m_executionInfo = null;
     m_hiddenParameters.Clear();
     if (doRefresh)
     {
         Refresh();
     }
     OnChange(isRefreshOnly: false);
 }
 public void SetDataSourceCredentials(IEnumerable <DataSourceCredentials> credentials)
 {
     lock (m_syncObject)
     {
         if (credentials == null)
         {
             throw new ArgumentNullException("credentials");
         }
         EnsureExecutionSession();
         m_executionInfo = Service.SetExecutionCredentials(credentials);
         OnChange(isRefreshOnly: false);
     }
 }
 internal override Report PerformDrillthrough(string drillthroughId, out string reportPath)
 {
     lock (m_syncObject)
     {
         if (!IsReadyForProcessingPostTasks)
         {
             throw new InvalidOperationException(CommonStrings.ReportNotReady);
         }
         ExecutionInfo executionInfo = Service.LoadDrillthroughTarget(drillthroughId);
         Service.SetExecutionId(m_executionID);
         reportPath = executionInfo.ReportPath;
         return(new ServerReport(this, executionInfo));
     }
 }
 public override void LoadReportDefinition(TextReader report)
 {
     lock (m_syncObject)
     {
         if (report == null)
         {
             throw new ArgumentNullException("report");
         }
         if (base.IsDrillthroughReport)
         {
             throw new InvalidOperationException();
         }
         string s     = report.ReadToEnd();
         byte[] bytes = Encoding.UTF8.GetBytes(s);
         m_executionInfo = Service.LoadReportDefinition(bytes);
         m_executionID   = m_executionInfo.ExecutionID;
         OnExecutionIDChanged();
         m_reportPath = "";
         Refresh();
     }
 }
 public override void SetParameters(IEnumerable <ReportParameter> parameters)
 {
     lock (m_syncObject)
     {
         if (parameters == null)
         {
             throw new ArgumentNullException("parameters");
         }
         EnsureExecutionSession();
         Dictionary <int, bool> dictionary = new Dictionary <int, bool>();
         foreach (ReportParameter parameter in parameters)
         {
             if (parameter == null || parameter.Name == null)
             {
                 throw new ArgumentNullException("parameters");
             }
             int indexForParameter = GetIndexForParameter(parameter.Name);
             if (dictionary.ContainsKey(indexForParameter))
             {
                 throw new ArgumentException(CommonStrings.ParameterSpecifiedMultipleTimes(parameter.Name));
             }
             dictionary.Add(indexForParameter, parameter.Visible);
         }
         m_executionInfo = Service.SetExecutionParameters(parameters, Thread.CurrentThread.CurrentCulture.Name);
         foreach (int key in dictionary.Keys)
         {
             if (dictionary[key])
             {
                 m_hiddenParameters.Remove(key);
             }
             else if (!m_hiddenParameters.Contains(key))
             {
                 m_hiddenParameters.Add(key);
             }
         }
         OnChange(isRefreshOnly: false);
     }
 }
 internal override int PerformSort(string sortId, SortOrder sortDirection, bool clearSort, PageCountMode pageCountMode, out string uniqueName)
 {
     lock (m_syncObject)
     {
         if (!IsReadyForProcessingPostTasks)
         {
             throw new InvalidOperationException(CommonStrings.ReportNotReady);
         }
         ExecutionInfo executionInfo;
         int           numPages;
         int           result = Service.Sort(sortId, sortDirection, clearSort, pageCountMode, out uniqueName, out executionInfo, out numPages);
         Service.SetExecutionId(m_executionID);
         if (executionInfo == null)
         {
             m_executionInfo.NumPages = numPages;
         }
         else
         {
             m_executionInfo = executionInfo;
         }
         return(result);
     }
 }
        public int Sort(string sortItem, SortOrder direction, bool clear, PageCountMode paginationMode, out string reportItem, out ExecutionInfo executionInfo, out int numPages)
        {
            Microsoft.Reporting.NETCore.Internal.Soap.ReportingServices2005.Execution.PageCountMode paginationMode2 = SoapPageCountFromViewerAPI(paginationMode);
            SortDirectionEnum direction2 = (direction == SortOrder.Ascending) ? SortDirectionEnum.Ascending : SortDirectionEnum.Descending;

            Microsoft.Reporting.NETCore.Internal.Soap.ReportingServices2005.Execution.ExecutionInfo ExecutionInfo;
            int result = Service.Sort(sortItem, direction2, clear, paginationMode2, out reportItem, out ExecutionInfo, out numPages);

            executionInfo = FromSoapExecutionInfo(ExecutionInfo);
            return(result);
        }