Exemplo n.º 1
0
        public string[] getReportResult(int reportId, List <AnalyticsReportFilter> filterList)
        {
            //Use RightNow SOAP API to run report and get RNow Contact search results
            //Set up Analytics Report
            //Create new AnalyticsReport Object
            AnalyticsReport analyticsReport = new AnalyticsReport();
            //create limit and start parameters. Specifies the max number of rows to return (10,000 is the overall maximum)
            //start specifies the starting row
            int limit = 10;
            int start = 0;

            //Specify a report ID
            ID reportID = new ID();

            //contact search report
            reportID.id          = reportId;
            reportID.idSpecified = true;
            analyticsReport.ID   = reportID;

            analyticsReport.Filters = filterList.ToArray();

            CSVTableSet thisset = new CSVTableSet();

            byte[] fd;

            // Run AnalyticsReport via SOAP API
            thisset = _rnowClient.RunAnalyticsReport(_rnowClientInfoHeader, analyticsReport, limit, start, ",", false, true, out fd);

            // Get Report Search Result
            CSVTable[] tableResults  = thisset.CSVTables;
            String[]   searchResults = tableResults[0].Rows;

            return(searchResults);
        }
Exemplo n.º 2
0
 internal override void ProcessData()
 {
     foreach (string sReportID in _reportIDList)
     {
         try
         {
             _activeReportID = sReportID;
             System.Net.ServicePointManager.SecurityProtocol = (System.Net.SecurityProtocolType) 3072;
             AnalyticsReport rpt = _serviceWrapper.getAnalyticsReport(ActiveReportID());
             if (rpt != null && !string.IsNullOrEmpty(rpt.Name))
             {
                 string cleanJobName = rpt.Name;
                 foreach (char c in System.IO.Path.GetInvalidFileNameChars())
                 {
                     cleanJobName = cleanJobName.Replace(c, '_');
                 }
                 cleanJobName = cleanJobName.Replace(' ', '_');
                 JOB_NAME     = cleanJobName;
             }
             base.ProcessData();
         }
         catch (Exception ex)
         {
             GlobalContext.Log(string.Format("Error processing: {0} - {1}\r\n{2}", GetJobName(), ex.Message, ex.StackTrace), true);
         }
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Get the CIR Pending Analytics Details.
        /// </summary>
        /// <param name="reportDetails">object</param>
        /// <param name="loginUserId">string</param>
        /// <returns>object</returns>
        public CIRPendingAnalyticsModel GetCIRPendingAnalyticsDetails(AnalyticsReport reportDetails, string loginUserId)
        {
            CIRPendingAnalyticsModel oReportModel = new CIRPendingAnalyticsModel();

            try
            {
                using (var connection = Connection())
                {
                    var result = connection.QueryMultiple("Rpt_CIRPENDINGAnalyticsnew", new
                    {
                        DateFrm = reportDetails.DateFrm,
                        DateTo  = reportDetails.DateTo,
                        Filter  = reportDetails.Filter == null ? "0" : reportDetails.Filter,
                        State   = reportDetails.State == null ? "0" : reportDetails.State,
                        Site    = reportDetails.Site == null ? "0" : reportDetails.Site,
                        WTGType = reportDetails.WTGType == null ? "0" : reportDetails.WTGType,
                        UId     = loginUserId
                    }, commandType: CommandType.StoredProcedure);

                    oReportModel.AnalyticsPointDetails = result.Read <CIRPendingAnalyticsPointDetails>().ToList();
                    oReportModel.AnalyticsPoint        = result.Read <CIRPendingAnalyticsPoint>().ToList();
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
            }
            return(oReportModel);
        }
        /// <summary>
        /// Get Result of Report based on Filter's passed
        /// </summary>
        /// <param name="filters">List of filter name and Values</param>
        /// <returns>CSVTable</returns>
        public CSVTable GetReportDetails(List <KeyValuePair <string, string> > filters)
        {
            try
            {
                AnalyticsReport analyticsreport = new AnalyticsReport {
                    ID = new ID {
                        id = WorkspaceAddIn._reportID, idSpecified = true
                    }
                };
                List <AnalyticsReportFilter> analyticsfilter = new List <AnalyticsReportFilter>();

                foreach (KeyValuePair <string, string> filter in filters)
                {
                    string filterName = filter.Key;
                    if (filterName == "Customer Name")
                    {
                        analyticsfilter.Add(new AnalyticsReportFilter
                        {
                            Name     = filter.Key,
                            Operator = new NamedID
                            {
                                ID = new ID
                                {
                                    id          = 7,
                                    idSpecified = true
                                }
                            },
                            Values = new string[] { filter.Value }
                        });
                    }
                    else
                    {
                        analyticsfilter.Add(new AnalyticsReportFilter
                        {
                            Name     = filter.Key,
                            Operator = new NamedID
                            {
                                ID = new ID
                                {
                                    id          = 1,
                                    idSpecified = true
                                }
                            },
                            Values = new string[] { filter.Value }
                        });
                    }
                }
                analyticsreport.Filters = analyticsfilter.ToArray();
                CSVTableSet tableset = RunReport(analyticsreport);
                if (tableset.CSVTables.Length > 0)
                {
                    return(tableset.CSVTables[0]);
                }
            }
            catch (Exception ex)
            {
                WorkspaceAddIn.InfoLog("Exception in GetReportDetails: " + ex.Message);
            }
            return(null);
        }
Exemplo n.º 5
0
        public JsonResult GetCIRPendingAnalyticsDetails(AnalyticsReport rptDetails)
        {
            rptDetails.DateFrm = ConvertDate(rptDetails.DateFrm);
            rptDetails.DateTo  = ConvertDate(rptDetails.DateTo);
            CIRPendingAnalyticsModel result = oReportManager.GetCIRPendingAnalyticsDetails(rptDetails, CookieManager.GetCookie(CookieManager.CookieName).logindetail.EmpID);

            return(Json(new { result }, JsonRequestBehavior.AllowGet));
        }
        public DialogSettingsAnalytics(AnalyticsReport report)
        {
            InitializeComponent();

            Text = Program.BrandName + " Options - Analytics Report";

            textBoxReport.EnableMultilineShortcuts();
            textBoxReport.Text = report.ToString().TrimEnd();
            textBoxReport.Select(0, 0);
        }
Exemplo n.º 7
0
        private async Task <AnalyticsReport> GetAnalytics()
        {
            try
            {
                if (System.Configuration.ConfigurationManager.AppSettings["GoogleAnalytics"] != "Yes")
                {
                    return new AnalyticsReport {
                               PageViews = "Disabled", Sessions = "Disabled"
                    }
                }
                ;

                if (HttpRuntime.Cache[CacheEnum.GooglePageViews] != null)
                {
                    return((AnalyticsReport)HttpRuntime.Cache[CacheEnum.GooglePageViews]);
                }

                string fileName    = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Data", "061868b5357ec57ce2cd01f7cba0d45c780d07f6-privatekey.p12");
                var    certificate = new X509Certificate2(fileName, "notasecret", X509KeyStorageFlags.Exportable | X509KeyStorageFlags.MachineKeySet);

                ServiceAccountCredential credential = new ServiceAccountCredential(
                    new ServiceAccountCredential.Initializer("*****@*****.**")
                {
                    Scopes = new[] { AnalyticsService.Scope.AnalyticsReadonly }
                }.FromCertificate(certificate));

                using (Google.Apis.Analytics.v3.AnalyticsService service = new Google.Apis.Analytics.v3.AnalyticsService(new BaseClientService.Initializer
                {
                    HttpClientInitializer = credential,
                    ApplicationName = "NSWC2014"
                }))
                {
                    var request = service.Data.Ga.Get("ga:87109047", DateTime.UtcNow.AddDays(-1).ToString("yyyy-MM-dd"), DateTime.UtcNow.ToString("yyyy-MM-dd"), "ga:pageviews,ga:sessions");
                    var result  = await request.ExecuteAsync();

                    var report = new AnalyticsReport {
                        PageViews = result.TotalsForAllResults["ga:pageviews"], Sessions = result.TotalsForAllResults["ga:sessions"]
                    };

                    HttpRuntime.Cache.Insert(CacheEnum.GooglePageViews, report, null, DateTime.UtcNow.AddMinutes(60), Cache.NoSlidingExpiration);
                    return(report);
                }
            }
            catch
            {
                return(new AnalyticsReport {
                    PageViews = "Pending..", Sessions = "Pending.."
                });
            }
        }
Exemplo n.º 8
0
        public JsonResult GetCIRStackedAnalyticsDetails(AnalyticsReport rptDetails)
        {
            string    Data1 = "";
            DataTable dtNew = null;

            rptDetails.DateFrm = ConvertDate(rptDetails.DateFrm);
            rptDetails.DateTo  = ConvertDate(rptDetails.DateTo);
            CIRPendingAnalyticsModel result = oReportManager.GetCIRPendingAnalyticsDetails(rptDetails, CookieManager.GetCookie(CookieManager.CookieName).logindetail.EmpID);

            if (result.AnalyticsPointDetails != null && result.AnalyticsPointDetails.Count > 0)
            {
                DataTable dt = ToDataTable <CIRPendingAnalyticsPointDetails>(result.AnalyticsPointDetails);
                dtNew = GenerateTransposedTable(dt);
                if (dtNew.Rows.Count > 0)
                {
                    string    _tmpLabel = "", _tmpDataValue = "";
                    DataTable dtFinal = new DataTable();
                    dtFinal.Clear();
                    dtFinal.Columns.Add("Label");
                    dtFinal.Columns.Add("Data");
                    /// dtFinal.Columns.Add("BackgroundColor");

                    for (int i = 0; i < dtNew.Rows.Count; i++)
                    {
                        _tmpLabel = _tmpDataValue = "";
                        for (int rCount = 1; rCount < dtNew.Columns.Count; rCount++)
                        {
                            _tmpLabel      = dtNew.Rows[i][0].ToString();
                            _tmpDataValue += _tmpDataValue.Length > 0 ? "," + dtNew.Rows[i][rCount].ToString() : dtNew.Rows[i][rCount].ToString();
                        }
                        DataRow _row = dtFinal.NewRow();
                        _row["Label"] = _tmpLabel;
                        _row["Data"]  = _tmpDataValue;
                        dtFinal.Rows.Add(_row);
                    }
                    Data1 = JsonConvert.SerializeObject(dtFinal);
                }
            }
            return(Json(new { Data1, result }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 9
0
        private static AnalyticsReport ConvertResponse(Google.Apis.AnalyticsReporting.v4.Data.Report report)
        {
            AnalyticsReport result = new AnalyticsReport();

            if (report.Data.RowCount > 0)
            {
                foreach (ReportRow rr in report.Data.Rows)
                {
                    AnalyticsRow row = new AnalyticsRow();
                    foreach (string d in rr.Dimensions)
                    {
                        row.Dimensions.Add(d);
                    }
                    foreach (DateRangeValues m in rr.Metrics)
                    {
                        row.Metrics.Add(Convert.ToInt32(m.Values[0]));
                    }
                    result.Add(row);
                }
            }
            return(result);
        }
        /// <summary>
        /// Funtion to Run the report
        /// </summary>
        /// <param name="report">AnalyticsReport info like report ID and Filter detail</param>
        /// <returns>CSVTableSet</returns>
        public CSVTableSet RunReport(AnalyticsReport report)
        {
            CSVTableSet reportdata = null;

            byte[] bytearray = null;
            try
            {
                ClientInfoHeader hdr = new ClientInfoHeader()
                {
                    AppID = "Get Report Data"
                };
                reportdata = _rightNowClient.RunAnalyticsReport(hdr, report, 10000, 0, "~", false, true, out bytearray);
                if (reportdata != null && reportdata.CSVTables.Length > 0)
                {
                    return(reportdata);
                }
            }
            catch (Exception ex)
            {
                WorkspaceAddIn.InfoLog("Exception in RunReport: " + ex.Message);
            }
            return(null);
        }
        public AnalyticsReport getAnalyticsReport(long reportID)
        {
            AnalyticsReport analyticsReport = new AnalyticsReport();
            ID analyticsReportID            = new ID();

            analyticsReportID.id          = reportID;
            analyticsReportID.idSpecified = true;
            analyticsReport.ID            = analyticsReportID;

            AnalyticsReportFilter filter = new AnalyticsReportFilter();

            analyticsReport.Filters = (new AnalyticsReportFilter[] { filter });

            GetProcessingOptions processingOptions = new GetProcessingOptions();

            processingOptions.FetchAllNames = true;

            RNObject[]      getAnalyticsObjects = new RNObject[] { analyticsReport };
            RNObject[]      rnObjects           = _client.Get(_clientInfoHeader, getAnalyticsObjects, processingOptions);
            AnalyticsReport report = (AnalyticsReport)rnObjects[0];

            return(report);
        }
Exemplo n.º 12
0
 Task IAnalyticsService.Add(AnalyticsReport rpt, CancellationToken cancellationToken)
 {
     return(this.analyticsRepository.Add(rpt, cancellationToken));
 }
Exemplo n.º 13
0
        /*  this method is called from framework to show the report row (data)
         *  refer to QA 140910-000144 for the story
         *  It combines the incident report (ConfigurationSetting.incidentsByContactReportID)
         *  and the ServiceRequest.LookupSRbyContactPartyID(contactPartyID)
         *  Currently this list is only showing certain fields (because of combining 2 lists with common fields)
         *  The Right Now incidents by a contact report is hidden, meaning the Report control of a contact
         *  workspace tab is based on the Siebel Service Request List Table report definition
         *  Also, do not change the default column heading of Right Now incidents by a contact report
         *  (they are hard coded to uppercase). Because they are hidden anyway.
         *  The Siebel Service Request List Table report definition column headings can be changed and those are
         *  the ones being displayed.
         */
        public override IList<IReportRow> GetRows(IList<string> columns, IReportFilterNode filterNode)
        {
            IList<IReportRow> reportRows = new List<IReportRow>();
            IRecordContext _context = ((SiebelVirtualReportTablesPackage)this.Parent)._globalContext.AutomationContext.CurrentWorkspace;

            if (_context == null)
                return reportRows;

            IContact contactRecord = _context.GetWorkspaceRecord(RightNow.AddIns.Common.WorkspaceRecordType.Contact) as IContact;

             /* if auto refresh every x sec is enabled even though the tab is not active
             * so need to check contactRecord for null (when the editor is different)
             */
            if (contactRecord == null)
                return reportRows;

            string contactPartyID = null;
            // get the ebs contact party custom attribute on the contact workspace
            contactPartyID = getContactPartyIdCustomAttr(contactRecord);

            // following to get the rNow incidents report and filter is the rNow contactID
            AnalyticsReport reportIncident = new AnalyticsReport();
            ID rId = new ID();
            rId.id = ConfigurationSetting.incidentsByContactReportID;
            rId.idSpecified = true;
            reportIncident.ID = rId;
            byte[] outByte = new byte[1000];

            AnalyticsReportFilter[] filter = new AnalyticsReportFilter[3];
            filter[0] = new AnalyticsReportFilter();

            String[] filterString = new String[1];
            filterString[0] = "" + contactRecord.ID;
            filter[0].Values = filterString;
            filter[0].Name = "Contact"; // incidents by a contact, thus Contact filter

            NamedID datatype = new NamedID();
            datatype.Name = "Integer";
            filter[0].DataType = datatype;

            reportIncident.Filters = filter;

            ClientInfoHeader _cih = new ClientInfoHeader();
            _cih.AppID = "Accelerator Report Add-In";
            Stopwatch stopwatch = new Stopwatch();
            stopwatch.Start();
            CSVTableSet tableSet = ConfigurationSetting.client.RunAnalyticsReport(
              _cih, reportIncident, 100, 0, "\t", false, false, out outByte
                );
            stopwatch.Stop();
            string logMessage = "Called RightNowSyncPortClient.RunAnalyticsReport." +
                "reportID: " + ConfigurationSetting.incidentsByContactReportID;
            ConfigurationSetting.logWrap.DebugLog(0, contactRecord.ID, logMessage: logMessage, timeElapsed: (int)stopwatch.ElapsedMilliseconds);

            CSVTable[] csvTables = tableSet.CSVTables;
            CSVTable table = csvTables[0];
            string[] rowData = table.Rows;
            int rNowIncidentCount = table.Rows.Length;
            int srVirtualTableCount = this.Columns.Count;
            string[] colHeadingIncidentReport = table.Columns.Split('\t');

            foreach (String commaRow in table.Rows)
            {
                ReportDataRow reportDataRow = new ReportDataRow(srVirtualTableCount);
                string[] colValue = commaRow.Split('\t');

                // the report output is stored as <columnHeading, value>
                Dictionary<string, string> dictRow = new Dictionary<string, string>();
                int i = 0;
                foreach (string val in colValue)
                {   /* make the column heading upper case (because the custom attribute heading
                     * in the report designer sometime all in lower case, sometime the reverse)
                     */
                    dictRow.Add(colHeadingIncidentReport[i].ToUpper(), val);
                    i++;
                }

                addRnowIncidentRow(ref columns, ref reportDataRow, ref reportRows, dictRow);
            }

            if (contactPartyID != null)
            {
                ServiceRequest[] sRs = ServiceRequest.LookupSRbyContactPartyID(columns, contactPartyID, 0, contactRecord.ID);

                if (sRs == null)
                    return reportRows;

                foreach (ServiceRequest req in sRs)
                {
                    ReportDataRow reportDataRow = new ReportDataRow(this.Columns.Count);
                    if (req != null) // live ebs row 316 of 319 of contact 4431 return null
                        addSiebelSrRow(ref columns, ref reportDataRow, ref reportRows, req);
                }
            }
            return reportRows;
        }
        internal RunAnalyticsResponse GetAnalyticsReportResults(long reportId, AnalyticsReportFilter[] filters,
                                                                int limit = 100, int start = 0, string delimiter = ",")
        {
            //Create new AnalyticsReport Object
            AnalyticsReport analyticsReport = new AnalyticsReport();
            //Specify a report ID of Public Reports>Common>Data integration>Opportunities
            ID reportID = new ID();

            reportID.id          = reportId;
            reportID.idSpecified = true;
            analyticsReport.ID   = reportID;

            analyticsReport.Filters = filters;

            GetProcessingOptions processingOptions = new GetProcessingOptions();

            processingOptions.FetchAllNames = true;

            RNObject[]  getAnalyticsObjects = new RNObject[] { analyticsReport };
            CSVTableSet thisSet             = new CSVTableSet();

            byte[] ignore;

            bool mustRetry  = false;    // used to determine if we should retry a failed job
            int  retryTimes = 0;        // we don't want to endlessly retry, so we only will retry 3 times

            do
            {
                try
                {
                    thisSet = _client.RunAnalyticsReport(_clientInfoHeader, analyticsReport, limit, start, delimiter, false, true, out ignore);

                    return(new RunAnalyticsResponse
                    {
                        RunAnalyticsTableSet = thisSet,
                        Successful = true,
                        SuccessfulSet = true
                    });
                }
                catch (Exception ex)
                {
                    GlobalContext.Log(string.Format("Failed RunAnalyticsReport: Retry {0}: {1}", retryTimes, ex.Message), true);
                    GlobalContext.Log(string.Format("Failed RunAnalyticsReport: Retry {0}: {1}{2}{3}", retryTimes, ex.Message, Environment.NewLine, ex.StackTrace), false);

                    if (retryTimes < 3)
                    {
                        // if we haven't retried 3 times then we retry the load again
                        mustRetry = true;
                        retryTimes++;
                    }
                    else
                    {
                        // don't retry for 3rd retry
                        return(new RunAnalyticsResponse
                        {
                            Successful = false,
                            SuccessfulSet = false,
                            Details = ex.Message
                        });
                    }
                }
                GlobalContext.Log(string.Format("RunAnalyticsReport Must Retry {0}", mustRetry), false);
            } while (mustRetry);
            GlobalContext.Log("RunAnalyticsReport End: This code should never be hit.", false);
            return(null);        // this code should never be hit
        }
Exemplo n.º 15
0
        public string[] getReportResult(int reportId, List<AnalyticsReportFilter> filterList)
        {
            //Use RightNow SOAP API to run report and get RNow Contact search results
            //Set up Analytics Report
            //Create new AnalyticsReport Object
            AnalyticsReport analyticsReport = new AnalyticsReport();
            //create limit and start parameters. Specifies the max number of rows to return (10,000 is the overall maximum)
            //start specifies the starting row
            int limit = 10;
            int start = 0;

            //Specify a report ID
            ID reportID = new ID();
            //contact search report
            reportID.id = reportId;
            reportID.idSpecified = true;
            analyticsReport.ID = reportID;

            analyticsReport.Filters = filterList.ToArray();

            CSVTableSet thisset = new CSVTableSet();
            byte[] fd;

            // Run AnalyticsReport via SOAP API
            thisset = _rnowClient.RunAnalyticsReport(_rnowClientInfoHeader, analyticsReport, limit, start, ",", false, true, out fd);

            // Get Report Search Result
            CSVTable[] tableResults = thisset.CSVTables;
            String[] searchResults = tableResults[0].Rows;

            return searchResults;
        }
Exemplo n.º 16
0
        /*  this method is called from framework to show the report row (data)
         *  It combines the incident report (ConfigurationSetting.incidentsByContactReportID)
         *  and the ServiceRequest.LookupSRbyContactPartyID(contactPartyID)
         *  Currently this list is only showing certain fields (because of combining 2 lists with common fields)
         *  The Right Now incidents by a contact report is hidden, meaning the Report control of a contact
         *  workspace tab is based on the EBS Service Request List Table report definition
         *  Also, do not change the default column heading of Right Now incidents by a contact report
         *  (they are hard coded to uppercase). Because they are hidden anyway.
         *  The EBS Service Request List Table report definition column headings can be changed and those are
         *  the ones being displayed.
         */
        public override IList <IReportRow> GetRows(IList <string> columns, IReportFilterNode filterNode)
        {
            IList <IReportRow> reportRows = new List <IReportRow>();
            IRecordContext     _context   = ((EBSVirtualReportTablesPackage)this.Parent)._globalContext.AutomationContext.CurrentWorkspace;

            if (_context == null)
            {
                return(reportRows);
            }

            IContact contactRecord = _context.GetWorkspaceRecord(RightNow.AddIns.Common.WorkspaceRecordType.Contact) as IContact;

            /* report framework refresh every 30 sec (default) even though the tab is not active
             * so need to check contactRecord for null (when the editor is different)
             */
            if (contactRecord == null)
            {
                return(reportRows);
            }

            int contactPartyID = 0;

            // get the ebs contact party custom attribute on the contact workspace
            contactPartyID = getContactPartyIdCustomAttr(contactRecord);

            // following to get the rNow incidents report and filter is the rNow contactID
            AnalyticsReport reportIncident = new AnalyticsReport();
            ID rId = new ID();

            rId.id            = ConfigurationSetting.incidentsByContactReportID;
            rId.idSpecified   = true;
            reportIncident.ID = rId;
            byte[] outByte = new byte[1000];

            AnalyticsReportFilter[] filter = new AnalyticsReportFilter[3];
            filter[0] = new AnalyticsReportFilter();

            String[] filterString = new String[1];
            filterString[0]  = "" + contactRecord.ID;
            filter[0].Values = filterString;
            filter[0].Name   = "Contact"; // incidents by a contact, thus Contact filter

            NamedID datatype = new NamedID();

            datatype.Name      = "Integer";
            filter[0].DataType = datatype;

            reportIncident.Filters = filter;

            ClientInfoHeader _cih = new ClientInfoHeader();

            _cih.AppID = "Accelerator Report Add-In";

            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            CSVTableSet tableSet = ConfigurationSetting.client.RunAnalyticsReport(
                _cih, reportIncident, 100, 0, "\t", false, false, out outByte
                );

            stopwatch.Stop();
            string logMessage = "Called RightNowSyncPortClient.RunAnalyticsReport." +
                                "reportID: " + ConfigurationSetting.incidentsByContactReportID;

            ConfigurationSetting.logWrap.DebugLog(0, contactRecord.ID, logMessage: logMessage, timeElapsed: (int)stopwatch.ElapsedMilliseconds);

            CSVTable[] csvTables = tableSet.CSVTables;
            CSVTable   table     = csvTables[0];

            string[] rowData             = table.Rows;
            int      rNowIncidentCount   = table.Rows.Length;
            int      srVirtualTableCount = this.Columns.Count;

            string[] colHeadingIncidentReport = table.Columns.Split('\t');

            foreach (String commaRow in table.Rows)
            {
                ReportDataRow reportDataRow = new ReportDataRow(srVirtualTableCount);
                string[]      colValue      = commaRow.Split('\t');

                // the report output is stored as <columnHeading, value>
                Dictionary <string, string> dictRow = new Dictionary <string, string>();
                int i = 0;
                foreach (string val in colValue)
                {   /* make the column heading upper case (because the custom attribute heading
                     * in the report designer sometime all in lower case, sometime the reverse)
                     */
                    dictRow.Add(colHeadingIncidentReport[i].ToUpper(), val);
                    i++;
                }

                addRnowIncidentRow(ref columns, ref reportDataRow, ref reportRows, dictRow);
            }

            if (contactPartyID > 0)
            {
                ServiceRequest[] sRs = ServiceRequest.LookupSRbyContactPartyID(contactPartyID, 0, contactRecord.ID);

                foreach (ServiceRequest req in sRs)
                {
                    ReportDataRow reportDataRow = new ReportDataRow(this.Columns.Count);
                    if (req != null) // live ebs row 316 of 319 of contact 4431 return null
                    {
                        addEBSsrRow(ref columns, ref reportDataRow, ref reportRows, req);
                    }
                }
            }
            return(reportRows);
        }
Exemplo n.º 17
0
 Task IAnalyticsRepository.Add(AnalyticsReport analyticsReport, CancellationToken cancellationToken)
 {
     this.client.AnalyticsReports.Add(analyticsReport);
     return(this.client.SaveChangesAsync(cancellationToken));
 }
		private void ProcessAnalyticsReport(AnalyticsReport report)
		{
			Analytics.TrackEvent(report.Name, report.Properties);
		}