/// <summary>TBD</summary>
 /// <param name="customerId">TBD</param>
 /// <param name="results">TBD</param>        
 public void GetWebResponse(string companyId, string customerId, out byte[] results)
 {
     SSRS_Reporting.ReportingService2005 reportingService = new SSRS_Reporting.ReportingService2005();
     SSRS_Reporting.ReportExecutionService reportExecService = new SSRS_Reporting.ReportExecutionService();
     reportingService.Credentials = CredentialCache.DefaultCredentials;
     reportExecService.Credentials = CredentialCache.DefaultCredentials;
     results = null;
     string historyId = null;
     string _historyId = null;
     string deviceInfo = null;
     string format = "EXCEL";
     string encoding = string.Empty;
     string mimeType = string.Empty;
     string extension = string.Empty;
     string[] streamIDs = null;
     string reportName = "/TOD - Custom Reports/Billing Credits and Payments by Account";
     bool _forRendering = false;
     SSRS_Reporting.Warning[] warnings = null;
     SSRS_Reporting.ParameterValue[] _values = null;
     SSRS_Reporting.DataSourceCredentials[] _credentials = null;
     SSRS_Reporting.ReportParameter[] _parameters = null;
     try
     {
         _parameters = reportingService.GetReportParameters(reportName, _historyId, _forRendering, _values, _credentials);
         SSRS_Reporting.ExecutionInfo ei = reportExecService.LoadReport(reportName, historyId);
         SSRS_Reporting.ParameterValue[] parameters = new SSRS_Reporting.ParameterValue[_parameters.Length];
         if (_parameters.Length > 0)
         {
             parameters[0] = new SSRS_Reporting.ParameterValue();
             parameters[0].Label = "companyId";
             parameters[0].Name = "companyId";
             parameters[0].Value = companyId;
             parameters[1] = new SSRS_Reporting.ParameterValue();
             parameters[1].Label = "lookupType";
             parameters[1].Name = "lookupType";
             parameters[1].Value = lookupType.Value;
             parameters[2] = new SSRS_Reporting.ParameterValue();
             parameters[2].Label = "searchText";
             parameters[2].Name = "searchText";
             parameters[2].Value = searchText.Value;
             parameters[3] = new SSRS_Reporting.ParameterValue();
             parameters[3].Label = "customerId";
             parameters[3].Name = "customerId";
             parameters[3].Value = customerId;
         }
         SSRS_Reporting.ExecutionInfo execInfo = reportExecService.SetExecutionParameters(parameters, "en-us");
         results = reportExecService.Render(format, deviceInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);
     }
     catch (Exception ex)
     {
         WebCommon.LogExceptionInfo(ex);
     }
 }
 /// <summary>TBD</summary>
 /// <param name="invoiceNumber">TBD</param>
 /// <param name="results">TBD</param>
 public void GetWebResponse(string invoiceNumber, int companyId, out byte[] results)
 {
     SSRS_Reporting.ReportingService2005 reportingService = new SSRS_Reporting.ReportingService2005();
     SSRS_Reporting.ReportExecutionService reportExecService = new SSRS_Reporting.ReportExecutionService();
     reportingService.Credentials = CredentialCache.DefaultCredentials;
     reportExecService.Credentials = CredentialCache.DefaultCredentials;
     results = null;
     string historyId = null;
     string _historyId = null;
     string deviceInfo = null;
     string format = "PDF";
     string encoding = string.Empty;
     string mimeType = string.Empty;
     string extension = string.Empty;
     string[] streamIDs = null;
     string reportName = (companyId == 1 ? "/SDS_Test/_wip/InvoiceReprint_WIP" : "/SDS_Test/_wip/InvoiceReprintCanada_WIP");
     bool _forRendering = false;
     SSRS_Reporting.Warning[] warnings = null;
     SSRS_Reporting.ParameterValue[] _values = null;
     SSRS_Reporting.DataSourceCredentials[] _credentials = null;
     SSRS_Reporting.ReportParameter[] _parameters = null;
     try
     {
         _parameters = reportingService.GetReportParameters(reportName, _historyId, _forRendering, _values, _credentials);
         SSRS_Reporting.ExecutionInfo ei = reportExecService.LoadReport(reportName, historyId);
         SSRS_Reporting.ParameterValue[] parameters = new SSRS_Reporting.ParameterValue[1];
         if (_parameters.Length > 0)
         {
             parameters[0] = new SSRS_Reporting.ParameterValue();
             parameters[0].Label = "invoiceNumber";
             parameters[0].Name = "invoiceNumber";
             parameters[0].Value = invoiceNumber;
         }
         reportExecService.SetExecutionParameters(parameters, "en-us");
         results = reportExecService.Render(format, deviceInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);
         //Response.Clear();
         //Response.ContentType = "application/octet-stream";
         //Response.AddHeader("content-disposition", "attachment; filename=test.PDF");
         //Response.Write(results);
         //Response.Flush();
     }
     catch (Exception ex)
     {
         WebCommon.LogExceptionInfo(ex);
     }
 }
        /// <summary>TBD</summary>
        /// <param name="customerId">TBD</param>
        /// <param name="results">TBD</param>        
        public void GetWebResponse(string contractNumber, out byte[] results)
        {
            SSRS_Reporting.ReportingService2005 reportingService = new SSRS_Reporting.ReportingService2005();
            SSRS_Reporting.ReportExecutionService reportExecService = new SSRS_Reporting.ReportExecutionService();
            reportingService.Credentials = CredentialCache.DefaultCredentials;
            reportExecService.Credentials = CredentialCache.DefaultCredentials;
            results = null;
            string historyId = null;
            string _historyId = null;
            string deviceInfo = null;
            string format = "EXCEL";
            string encoding = string.Empty;
            string mimeType = string.Empty;
            string extension = string.Empty;
            string[] streamIDs = null;
            string reportName = "/TOD - Custom Reports/ContractSummary_PostingSchedule";
            bool _forRendering = false;
            SSRS_Reporting.Warning[] warnings = null;
            SSRS_Reporting.ParameterValue[] _values = null;
            SSRS_Reporting.DataSourceCredentials[] _credentials = null;
            SSRS_Reporting.ReportParameter[] _parameters = null;
            try
            {
                _parameters = reportingService.GetReportParameters(reportName, _historyId, _forRendering, _values, _credentials);
                SSRS_Reporting.ExecutionInfo ei = reportExecService.LoadReport(reportName, historyId);
                SSRS_Reporting.ParameterValue[] parameters = new SSRS_Reporting.ParameterValue[_parameters.Length];
                if (_parameters.Length > 0)
                {
                    parameters[0] = new SSRS_Reporting.ParameterValue();
                    parameters[0].Label = "contractNumber";
                    parameters[0].Name = "contractNumber";
                    parameters[0].Value = contractNumber;

                }
                SSRS_Reporting.ExecutionInfo execInfo = reportExecService.SetExecutionParameters(parameters, "en-us");
                results = reportExecService.Render(format, deviceInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);
            }
            catch (Exception ex)
            {
                WebCommon.LogExceptionInfo(ex);
            }
        }