public override void Process(ReportProcessorArgs args) { IElementDictionary <IElementCustomerLookup> entries = GetElementDictionary(args); IList <KeyValuePair <string, IElementCustomerLookup> > companyInfoList = new List <KeyValuePair <string, IElementCustomerLookup> >(); companyInfoList = (from key in entries.Keys select new KeyValuePair <string, IElementCustomerLookup>(key, new ReadonlyElementCustomerLookup(entries[key])) into kvp orderby kvp.Key select kvp).ToList(); var resultTable = CompanyInfoHelper.CreateCompanyDataTable("CompanyInfo"); foreach (var companies in companyInfoList) { DataRow dataRow = resultTable.NewRow(); resultTable.Rows.Add(CompanyInfoHelper.FillCompanyDataTable(dataRow, companies.Value)); } args.QueryResult = resultTable; }
public override void Process(ReportProcessorArgs args) { var queryExpression = this.CreateQuery().Build(); var table = base.GetTableFromContactQueryExpression(queryExpression, args.ReportParameters.ContactId, null); args.QueryResult = table; }
public override void Process(ReportProcessorArgs args) { Guid result; DataTable contactQueryExpression; if (Guid.TryParse(args.ReportParameters.ViewEntityId, out result)) { if (!_pageEventsQuery.QueryParms.ContainsKey("_id")) { _pageEventsQuery.QueryParms.Add("_id", "@interactionid"); } contactQueryExpression = GetTableFromContactQueryExpression(_pageEventsQuery.Build(), args.ReportParameters.ContactId, result); } else { if (_pageEventsQuery.QueryParms.ContainsKey("_id")) { _pageEventsQuery.QueryParms.Remove("_id"); } contactQueryExpression = GetTableFromContactQueryExpression(_pageEventsQuery.Build(), args.ReportParameters.ContactId, new Guid?()); } args.QueryResult = contactQueryExpression; }
public override void Process(ReportProcessorArgs args) { InitializeArguments(args); if (!DatatableSupportsAttendeeData()) return; AddRowsToDataTable(); SetViewDataTable(args); }
public override void Process(ReportProcessorArgs args) { var queryResult = args.QueryResult; var resultTableForView = args.ResultTableForView; foreach (var sourceRow in queryResult.AsEnumerable()) { if (!RowShouldBeSkipped(sourceRow)) { var dataRow = resultTableForView.NewRow(); var mediaPath = sourceRow.Field <string>("Pages_PageEvents_DataKey"); var mediaItem = Context.Database.GetItem(mediaPath); if (mediaItem != null) { dataRow.SetField(Schema.FileName.Name, mediaItem.DisplayName); dataRow.SetField(Schema.FileItemPath.Name, mediaPath); } var pageItemId = sourceRow.Field <Guid>("Pages_Item__id"); var pageItem = GetItemFromCurrentContext(pageItemId); if (pageItem != null) { dataRow.SetField(Schema.PageName.Name, pageItem.DisplayName); dataRow.SetField(Schema.PageItemPath.Name, pageItem.Paths.FullPath); } var datetime = sourceRow.Field <DateTime>("Pages_PageEvents_DateTime").ToLocalTime(); dataRow.SetField(Schema.DownloadedOn.Name, datetime.ToString(CultureInfo.CurrentUICulture)); resultTableForView.Rows.Add(dataRow); } } }
public override void Process(ReportProcessorArgs args) { var xConnectService = new XconnectService(); var facets = Task.Run(() => xConnectService.GetContactFacets(args.ReportParameters.ContactId)).Result; var table = CreateDataTable(facets); args.ResultSet.Data.Dataset[args.ReportParameters.ViewName] = table; }
public override void Process(ReportProcessorArgs args) { if (args.ResultTableForView == null) { return; } args.ResultTableForView.Columns.Add(Schemas.GoalDescription.ToColumn()); }
public IElementDictionary <IElementCustomerLookup> GetElementDictionary(ReportProcessorArgs args) { IContactCustomerLookups facet = (IContactCustomerLookups) Sitecore.Cintel.CustomerIntelligenceManager.ContactService.GetFacet( args.ReportParameters.ContactId, "CompanyInformation"); return(facet.Entries); }
public override void Process(ReportProcessorArgs args) { args.ResultTableForView = new DataTable(); args.ResultTableForView.Columns.Add(Schema.FileName.ToColumn()); args.ResultTableForView.Columns.Add(Schema.FileItemPath.ToColumn()); args.ResultTableForView.Columns.Add(Schema.PageName.ToColumn()); args.ResultTableForView.Columns.Add(Schema.PageItemPath.ToColumn()); args.ResultTableForView.Columns.Add(Schema.DownloadedOn.ToColumn()); }
public override void Process(ReportProcessorArgs args) { var result = args.QueryResult; args.ResultTableForView = new DataTable(); this.InitializeDataTable(args.ResultTableForView); this.PopulateData(args.ResultTableForView, args.ReportParameters.ContactId); args.ResultSet.Data.Dataset[args.ReportParameters.ViewName] = args.ResultTableForView; }
public override void Process(ReportProcessorArgs args) { var ctx = ContentSearchManager.GetIndex(CustomerIntelligenceConfig.ContactSearch.SearchIndexName).CreateSearchContext(SearchSecurityOptions.Default); try { var pageSize = args.ReportParameters.PageSize; var collection = ctx.GetQueryable <IndexedContact>() .OrderByDescending(r => r.LatestVisitDate) .Skip((args.ReportParameters.PageNumber - 1) * pageSize) .Take(pageSize); args.ResultSet.TotalResultCount = ctx.GetQueryable <IndexedContact>().Count(); collection.ForEach(sr => { var sr1 = sr; var row = args.ResultTableForView.NewRow(); BuildBaseResult(row, sr1); args.ResultTableForView.Rows.Add(row); var visit = ctx.GetQueryable <IndexedVisit>() .Where(iv => iv.ContactId == sr1.ContactId) .OrderByDescending(iv => iv.StartDateTime) .Take(1).FirstOrDefault(); if (visit == null) { return; } PopulateLatestVisit(visit, ref row); var company = ctx.GetQueryable <IndexedCompany>() .Where(iv => iv.ContactId == sr1.ContactId) .OrderByDescending(iv => iv.Company); if (company.Any() && company.FirstOrDefault().Company != null) { PopulateCompany(company.FirstOrDefault(), ref row); } else { row["Company"] = "unknown"; } }); } finally { if (ctx != null) { ctx.Dispose(); } } }
public override void Process(ReportProcessorArgs args) { var columns = new DataColumn[] { new ViewField <string>(AIFacet._RESULT).ToColumn(), new ViewField <string>(AIFacet._TRAINING).ToColumn() }; args.ResultTableForView = new DataTable(); args.ResultTableForView.Columns.AddRange(columns); }
public override void Process(ReportProcessorArgs args) { var queryResult = args.QueryResult; var viewTable = args.ResultTableForView; foreach (DataRow row in queryResult.Rows) { viewTable.Rows.Add(row.ItemArray); } args.ResultSet.Data.Dataset[args.ReportParameters.ViewName] = viewTable; }
public override void Process(ReportProcessorArgs args) { ICustomDataFacet fullFacet = (ICustomDataFacet)CustomerIntelligenceManager.ContactService.GetFacet(args.ReportParameters.ContactId, "CustomData"); var result = args.QueryResult; var table = args.ResultTableForView; foreach (DataRow row in result.AsEnumerable()) { var targetRow = table.NewRow(); // CRM ID var id = row["CustomData_CrmId"]; if (id == null || string.IsNullOrEmpty(id.ToString())) { continue; } targetRow["CrmId"] = id; // Active Customer var activeCustomer = row["CustomData_ActiveCustomer"]; if (activeCustomer == null || string.IsNullOrEmpty(id.ToString())) { continue; } targetRow["ActiveCustomer"] = activeCustomer; // Product Purchases DataTable productPurchases = new DataTable(); productPurchases.Columns.Add("Product", typeof(string)); productPurchases.Columns.Add("Date", typeof(DateTime)); if (fullFacet.ProductPurchases != null && fullFacet.ProductPurchases.Any()) { foreach (var purchase in fullFacet.ProductPurchases) { productPurchases.Rows.Add(purchase.ProductId, purchase.PurchaseDate); } } targetRow["ProductPurchases"] = productPurchases; table.Rows.Add(targetRow); } args.ResultSet.Data.Dataset[args.ReportParameters.ViewName] = table; }
public override void Process(ReportProcessorArgs args) { DataTable tableWithSchema = this.CreateTableWithSchema(); Guid contactId = args.ReportParameters.ContactId; Guid result; if (Guid.TryParse(args.ReportParameters.ViewEntityId, out result)) { this.GetTableFromContactXconnect(tableWithSchema, args.ReportParameters.ContactId, new Guid?(result)); } else { this.GetTableFromContactXconnect(tableWithSchema, contactId, new Guid?()); } args.QueryResult = tableWithSchema; }
public override void Process(ReportProcessorArgs args) { args.ResultTableForView = new DataTable(); var viewField = new ViewField <string>("CrmId"); args.ResultTableForView.Columns.Add(viewField.ToColumn()); var customViewField = new ViewField <bool>("ActiveCustomer"); args.ResultTableForView.Columns.Add(customViewField.ToColumn()); var productViewField = new ViewField <DataTable>("ProductPurchases"); args.ResultTableForView.Columns.Add(productViewField.ToColumn()); }
public override void Process(ReportProcessorArgs args) { var result = args.QueryResult; args.ResultTableForView = new DataTable(); this.InitializeDataTable(args.ResultTableForView); long orderNumber; if (long.TryParse(args.ReportParameters.ViewEntityId, out orderNumber)) { this.PopulateData(args.ResultTableForView, args.ReportParameters.ContactId, orderNumber); args.ResultSet.Data.Dataset[args.ReportParameters.ViewName] = args.ResultTableForView; } }
public override void Process(ReportProcessorArgs args) { if (args.ResultTableForView.Rows.Count == 0) { return; } var minLabelValue = double.Parse(ConfigurationManager.AppSettings["MinValueToShowTag"] ?? "80"); var columnName = AIFacet.FacetName + AIFacet._RESULT; args.ResultTableForView.Columns.Add(new ViewField <string>(columnName).ToColumn()); foreach (DataRow row in args.ResultTableForView.Rows) { row[columnName] = _contact.GetAIResult(new Guid(row["ContactId"].ToString()), minLabelValue); } }
public override void Process(ReportProcessorArgs args) { DataTable resultTableForView = args.ResultTableForView; Assert.IsNotNull(resultTableForView, "Result table for {0} could not be found.", new object[] { args.ReportParameters.ViewName }); int i = 0; foreach (DataRow row in resultTableForView.AsEnumerable()) { var goalData = args.QueryResult.Rows[i].ItemArray.Last(); if (goalData != null) { row[Schemas.GoalDescription.Name] = goalData; } i++; } }
public override void Process(ReportProcessorArgs args) { var result = args.QueryResult; var table = args.ResultTableForView; if (table.Columns.Contains("DeveloperId")) { foreach (DataRow row in result.AsEnumerable()) { var id = row["DeveloperData_DeveloperId"]; if (id == null || string.IsNullOrEmpty(id.ToString())) { continue; } var targetRow = table.NewRow(); targetRow["DeveloperId"] = id; table.Rows.Add(targetRow); } } args.ResultSet.Data.Dataset[args.ReportParameters.ViewName] = table; }
public override void Process(ReportProcessorArgs args) { args.ResultTableForView = new DataTable(); args.ResultTableForView.Columns.Add(Schema.ContactId.ToColumn()); args.ResultTableForView.Columns.Add(Schema.ContactIdentificationLevel.ToColumn()); args.ResultTableForView.Columns.Add(Schema.FirstName.ToColumn()); args.ResultTableForView.Columns.Add(Schema.MiddleName.ToColumn()); args.ResultTableForView.Columns.Add(Schema.Surname.ToColumn()); args.ResultTableForView.Columns.Add(Schema.EmailAddress.ToColumn()); args.ResultTableForView.Columns.Add(Schema.Value.ToColumn()); args.ResultTableForView.Columns.Add(Schema.VisitCount.ToColumn()); args.ResultTableForView.Columns.Add(Schema.ValuePerVisit.ToColumn()); args.ResultTableForView.Columns.Add(Schema.LatestVisitValue.ToColumn()); args.ResultTableForView.Columns.Add(Schema.LatestVisitDuration.ToColumn()); args.ResultTableForView.Columns.Add(Schema.LatestVisitRegionDisplayName.ToColumn()); args.ResultTableForView.Columns.Add(Schema.LatestVisitCountryDisplayName.ToColumn()); args.ResultTableForView.Columns.Add(Schema.LatestVisitCityDisplayName.ToColumn()); args.ResultTableForView.Columns.Add(Schema.LatestVisitBusinessName.ToColumn()); args.ResultTableForView.Columns.Add(Schema.LatestVisitStartDateTime.ToColumn()); args.ResultTableForView.Columns.Add(Schema.LatestVisitEndDateTime.ToColumn()); args.ResultTableForView.Columns.Add(new ViewField <string>("VisitIp").ToColumn()); args.ResultTableForView.Columns.Add(new ViewField <string>("Company").ToColumn()); }
private void InitializeArguments(ReportProcessorArgs args) { queryResult = args.QueryResult; resultTableForView = args.ResultTableForView; }
private void SetViewDataTable(ReportProcessorArgs args) { args.ResultSet.Data.Dataset[args.ReportParameters.ViewName] = resultTableForView; }
public override void Process(ReportProcessorArgs args) { var result = args.QueryResult; var table = args.ResultTableForView; if (table.Columns.Contains("Name") && result.Rows.Count > 0 && result.Rows[0]["CompanyData_Name"] != null && !string.IsNullOrEmpty(result.Rows[0]["CompanyData_Name"].ToString())) { foreach (DataRow row in result.AsEnumerable()) { var targetRow = table.NewRow(); var name = row["CompanyData_Name"]; if (name != null && !string.IsNullOrEmpty(name.ToString())) { targetRow["Name"] = name; } var website = row["CompanyData_Website"]; if (website != null && !string.IsNullOrEmpty(website.ToString())) { targetRow["Website"] = website; } var street = row["CompanyData_Street"]; if (street != null && !string.IsNullOrEmpty(street.ToString())) { targetRow["Street"] = street; } var city = row["CompanyData_City"]; if (city != null && !string.IsNullOrEmpty(city.ToString())) { targetRow["City"] = city; } var cid = row["CompanyData_Cid"]; if (cid != null && !string.IsNullOrEmpty(cid.ToString())) { targetRow["Cid"] = cid; } var regionShort = row["CompanyData_RegionShort"]; if (regionShort != null && !string.IsNullOrEmpty(regionShort.ToString())) { targetRow["RegionShort"] = regionShort; } var region = row["CompanyData_Region"]; if (region != null && !string.IsNullOrEmpty(region.ToString())) { targetRow["Region"] = region; } var postal = row["CompanyData_Postal"]; if (postal != null && !string.IsNullOrEmpty(postal.ToString())) { targetRow["postal"] = postal; } var countryShort = row["CompanyData_CountryShort"]; if (countryShort != null && !string.IsNullOrEmpty(countryShort.ToString())) { targetRow["CountryShort"] = countryShort; } var country = row["CompanyData_Country"]; if (country != null && !string.IsNullOrEmpty(country.ToString())) { targetRow["Country"] = country; } var phone = row["CompanyData_Phone"]; if (phone != null && !string.IsNullOrEmpty(phone.ToString())) { targetRow["Phone"] = phone; } var employees = row["CompanyData_Employees"]; if (employees != null && !string.IsNullOrEmpty(employees.ToString())) { targetRow["Employees"] = employees; } var revenue = row["CompanyData_Revenue"]; if (revenue != null && !string.IsNullOrEmpty(revenue.ToString())) { targetRow["Revenue"] = revenue; } var category = row["CompanyData_Category"]; if (category != null && !string.IsNullOrEmpty(category.ToString())) { targetRow["Category"] = category; } var sicCode = row["CompanyData_SicCode"]; if (sicCode != null && !string.IsNullOrEmpty(sicCode.ToString())) { targetRow["SicCode"] = sicCode; } var latitude = row["CompanyData_Latitude"]; if (latitude != null && !string.IsNullOrEmpty(latitude.ToString())) { targetRow["Latitude"] = latitude; } var longitude = row["CompanyData_Longitude"]; if (longitude != null && !string.IsNullOrEmpty(longitude.ToString())) { targetRow["Longitude"] = longitude; } var stockSymbol = row["CompanyData_StockSymbol"]; if (stockSymbol != null && !string.IsNullOrEmpty(stockSymbol.ToString())) { targetRow["StockSymbol"] = stockSymbol; } var facebook = row["CompanyData_Facebook"]; if (facebook != null && !string.IsNullOrEmpty(facebook.ToString())) { targetRow["Facebook"] = facebook; } var twitter = row["CompanyData_Twitter"]; if (twitter != null && !string.IsNullOrEmpty(twitter.ToString())) { targetRow["Twitter"] = twitter; } var linkedIn = row["CompanyData_LinkedIn"]; if (linkedIn != null && !string.IsNullOrEmpty(linkedIn.ToString())) { targetRow["LinkedIn"] = linkedIn; } var linkedInId = row["CompanyData_LinkedInId"]; if (linkedInId != null && !string.IsNullOrEmpty(linkedInId.ToString())) { targetRow["LinkedInId"] = linkedInId; } var isIsp = row["CompanyData_IsIsp"]; if (isIsp != null && !string.IsNullOrEmpty(isIsp.ToString())) { targetRow["IsIsp"] = isIsp; } var confidence = row["CompanyData_Confidence"]; if (confidence != null && !string.IsNullOrEmpty(confidence.ToString())) { targetRow["Confidence"] = confidence; } table.Rows.Add(targetRow); } } args.ResultSet.Data.Dataset[args.ReportParameters.ViewName] = table; }
public override void Process(ReportProcessorArgs args) { args.ResultTableForView = new DataTable(); args.ResultTableForView.Columns.Add(new ViewField<bool>("Attending").ToColumn()); args.ResultTableForView.Columns.Add(new ViewField<string>("AttendeeId").ToColumn()); }
public override void Process(ReportProcessorArgs args) { args.ResultTableForView = new DataTable(); var viewField = new ViewField<string>("DeveloperId"); args.ResultTableForView.Columns.Add(viewField.ToColumn()); }
public override void Process(ReportProcessorArgs args) { DataTable goalsData = GetGoalsData(args.ReportParameters.ContactId); args.QueryResult = goalsData; }
public override void Process(ReportProcessorArgs args) { var queryExpression = this.CreateQuery().Build(); var table = GetTableFromContactQueryExpression(queryExpression, args.ReportParameters.ContactId, null); args.QueryResult = table; }
public override void Process(ReportProcessorArgs args) { args.ResultTableForView = CompanyInfoHelper.CreateCompanyDataTable("CompanyInfo"); }
public override void Process(ReportProcessorArgs args) { // if we are looking for history, we want a few things // 1. We want to skip the latest record since it is in the "Current Company" // 2. If there is only 1 record, skip it. // if we are looking for current, we only want the latest record. bool history = false; if (args.ReportParameters.AdditionalParameters.Any(x => x.Key == "type" && x.Value.ToString() == "history")) { history = true; } //if (args.ReportParameters.AdditionalParameters["type"] != null // && args.ReportParameters.AdditionalParameters["type"].ToString() == "history") // history = true; var result = args.QueryResult; var table = args.ResultTableForView; if (table.Columns.Contains("Name") && ((history && result.Rows.Count > 1) || !history)) { IEnumerable <DataRow> orderedRows = result.AsEnumerable() .OrderByDescending(r => r.Field <DateTime>("Modified")); int i = 0; foreach (DataRow row in orderedRows) { // if we want the current, only send bak the 1st record. The latest. if ((!history && i == 0) || (history && i > 0)) { var targetRow = table.NewRow(); #region Add Data var name = row["Name"]; if (name != null && !string.IsNullOrEmpty(name.ToString())) { targetRow["Name"] = name; } var website = row["Website"]; if (website != null && !string.IsNullOrEmpty(website.ToString())) { targetRow["Website"] = website; } var street = row["Street"]; if (street != null && !string.IsNullOrEmpty(street.ToString())) { targetRow["Street"] = street; } var city = row["City"]; if (city != null && !string.IsNullOrEmpty(city.ToString())) { targetRow["City"] = city; } var cid = row["Cid"]; if (cid != null && !string.IsNullOrEmpty(cid.ToString())) { targetRow["Cid"] = cid; } var regionShort = row["RegionShort"]; if (regionShort != null && !string.IsNullOrEmpty(regionShort.ToString())) { targetRow["RegionShort"] = regionShort; } var region = row["Region"]; if (region != null && !string.IsNullOrEmpty(region.ToString())) { targetRow["Region"] = region; } var postal = row["postal"]; if (postal != null && !string.IsNullOrEmpty(postal.ToString())) { targetRow["postal"] = postal; } var countryShort = row["CountryShort"]; if (countryShort != null && !string.IsNullOrEmpty(countryShort.ToString())) { targetRow["CountryShort"] = countryShort; } var country = row["Country"]; if (country != null && !string.IsNullOrEmpty(country.ToString())) { targetRow["Country"] = country; } var phone = row["Phone"]; if (phone != null && !string.IsNullOrEmpty(phone.ToString())) { targetRow["Phone"] = phone; } var employees = row["Employees"]; if (employees != null && !string.IsNullOrEmpty(employees.ToString())) { targetRow["Employees"] = employees; } var revenue = row["Revenue"]; if (revenue != null && !string.IsNullOrEmpty(revenue.ToString())) { targetRow["Revenue"] = revenue; } var category = row["Category"]; if (category != null && !string.IsNullOrEmpty(category.ToString())) { targetRow["Category"] = category; } var sicCode = row["SicCode"]; if (sicCode != null && !string.IsNullOrEmpty(sicCode.ToString())) { targetRow["SicCode"] = sicCode; } var latitude = row["Latitude"]; if (latitude != null && !string.IsNullOrEmpty(latitude.ToString())) { targetRow["Latitude"] = latitude; } var longitude = row["Longitude"]; if (longitude != null && !string.IsNullOrEmpty(longitude.ToString())) { targetRow["Longitude"] = longitude; } var stockSymbol = row["StockSymbol"]; if (stockSymbol != null && !string.IsNullOrEmpty(stockSymbol.ToString())) { targetRow["StockSymbol"] = stockSymbol; } var facebook = row["Facebook"]; if (facebook != null && !string.IsNullOrEmpty(facebook.ToString())) { targetRow["Facebook"] = facebook; } var twitter = row["Twitter"]; if (twitter != null && !string.IsNullOrEmpty(twitter.ToString())) { targetRow["Twitter"] = twitter; } var linkedIn = row["LinkedIn"]; if (linkedIn != null && !string.IsNullOrEmpty(linkedIn.ToString())) { targetRow["LinkedIn"] = linkedIn; } var linkedInId = row["LinkedInId"]; if (linkedInId != null && !string.IsNullOrEmpty(linkedInId.ToString())) { targetRow["LinkedInId"] = linkedInId; } var isIsp = row["IsIsp"]; if (isIsp != null && !string.IsNullOrEmpty(isIsp.ToString())) { targetRow["IsIsp"] = isIsp; } var confidence = row["Confidence"]; if (confidence != null && !string.IsNullOrEmpty(confidence.ToString())) { targetRow["Confidence"] = confidence; } #endregion table.Rows.Add(targetRow); } i++; } } args.ResultSet.Data.Dataset[args.ReportParameters.ViewName] = table; args.ResultSet.TotalResultCount = table.Rows.Count; }