protected void addItem(ref IList <string> columns, ref ReportDataRow reportDataRow, ref IList <IReportRow> reportRows, IReport item) { foreach (var column in columns) { ReportDataCell reportDataCell = new ReportDataCell(); Tuple <ReportColumnType, object> field = item.getVirtualColumnValue(column.Replace(this.Parent.Name + "$" + this.Name + ".", "")); ReportColumnType type = field.Item1; switch (type) { case ReportColumnType.Integer: reportDataCell.GenericValue = Convert.ToInt32(field.Item2); break; case ReportColumnType.String: reportDataCell.GenericValue = Convert.ToString(field.Item2); break; case ReportColumnType.DateTime: reportDataCell.GenericValue = Convert.ToDateTime(field.Item2); break; case ReportColumnType.Boolean: reportDataCell.GenericValue = Convert.ToBoolean(field.Item2); break; } reportDataRow.Cells.Add(reportDataCell); } reportRows.Add(reportDataRow); }
// used by SR and Contact Details, and null check before doing Convert. protected void addDetailRow(Dictionary <string, string> dictDetail, ref IList <string> columns, ref ReportDataRow reportDataRow, ref IList <IReportRow> reportRows) { foreach (string column in columns) { ReportDataCell reportDataCell = new ReportDataCell(); // put the "Siebel$SRDetailTable." package name back, that's required by the report framework string pkgNtblName = "Siebel$" + this.Name + "."; string removePkgTblName = column.Replace(pkgNtblName, ""); string[] typeValArray = Regex.Split(dictDetail[removePkgTblName], TYPE_VALUE_DELIMITER); string type = typeValArray[0]; string val = typeValArray[1]; switch (type) { case "String": reportDataCell.GenericValue = val; break; case "Integer": if (val != null && val != "") { reportDataCell.GenericValue = Convert.ToInt32(val); } else { reportDataCell.GenericValue = null; } break; case "DateTime": if (val != null && val != "" && !val.Contains("1/1/0001")) { reportDataCell.GenericValue = Convert.ToDateTime(val); } else { reportDataCell.GenericValue = null; } break; case "Boolean": if (val != null && val != "") { reportDataCell.GenericValue = Convert.ToBoolean(val); } else { reportDataCell.GenericValue = null; } break; } reportDataRow.Cells.Add(reportDataCell); } reportRows.Add(reportDataRow); }
// Add Siebel Service Request row private void addSiebelSrRow(ref IList <string> columns, ref ReportDataRow reportDataRow, ref IList <IReportRow> reportRows, Hashtable srHashtable, ServiceRequest req) { bool srInRnow = false; foreach (var column in columns) { ReportDataCell reportDataCell = new ReportDataCell(); switch (column) { case "Siebel$SRlistTable.SrNumber": reportDataCell.GenericValue = req.RequestNumber; if (srHashtable.ContainsKey(req.RequestNumber)) { srInRnow = true; } break; case "Siebel$SRlistTable.Status": reportDataCell.GenericValue = req.Status; break; case "Siebel$SRlistTable.Summary": reportDataCell.GenericValue = req.Summary; break; case "Siebel$SRlistTable.Created": reportDataCell.GenericValue = req.RequestDate; break; case "Siebel$SRlistTable.IncidentRef": reportDataCell.GenericValue = ""; break; case "Siebel$SRlistTable.HiddenSRconcatIncident_ID": reportDataCell.GenericValue = req.RequestID + "_"; break; } reportDataRow.Cells.Add(reportDataCell); } if (!srInRnow) { reportRows.Add(reportDataRow); srInRnow = false; } }
// Add Siebel Service Request row private void addSiebelSrRow(ref IList<string> columns, ref ReportDataRow reportDataRow, ref IList<IReportRow> reportRows, ServiceRequest req) { foreach (var column in columns) { ReportDataCell reportDataCell = new ReportDataCell(); switch (column) { case "Siebel$SRlistTable.SrNumber": reportDataCell.GenericValue = req.RequestNumber; break; case "Siebel$SRlistTable.Status": reportDataCell.GenericValue = req.Status; break; case "Siebel$SRlistTable.Summary": reportDataCell.GenericValue = req.Summary; break; case "Siebel$SRlistTable.Created": reportDataCell.GenericValue = req.RequestDate; break; case "Siebel$SRlistTable.IncidentRef": reportDataCell.GenericValue = ""; break; case "Siebel$SRlistTable.HiddenSRconcatIncident_ID": reportDataCell.GenericValue = req.RequestID + "_"; break; } reportDataRow.Cells.Add(reportDataCell); } reportRows.Add(reportDataRow); }
// add Right Now Incident report row private void addRnowIncidentRow(ref IList<string> columns, ref ReportDataRow reportDataRow, ref IList<IReportRow> reportRows, Dictionary<string, string> colValue) { string heading = null; string dateTimeString = null; try { foreach (var column in columns) { ReportDataCell reportDataCell = new ReportDataCell(); switch (column) { case "Siebel$SRlistTable.SrNumber": heading = "SIEBEL_SR_NUM"; reportDataCell.GenericValue = colValue[heading]; break; case "Siebel$SRlistTable.IncidentRef": heading = "REFERENCE #"; reportDataCell.GenericValue = colValue[heading]; break; case "Siebel$SRlistTable.Created": heading = "DATE CREATED"; dateTimeString = colValue[heading]; // remove the single ' dateTimeString = dateTimeString.TrimStart('\''); dateTimeString = dateTimeString.TrimEnd('\''); reportDataCell.GenericValue = Convert.ToDateTime(dateTimeString); break; case "Siebel$SRlistTable.Summary": heading = "SUBJECT"; reportDataCell.GenericValue = colValue[heading]; break; case "Siebel$SRlistTable.Status": heading = "STATUS"; reportDataCell.GenericValue = colValue[heading]; break; case "Siebel$SRlistTable.HiddenSRconcatIncident_ID": heading = "INCIDENT ID"; // colValue[5] is hiddent IncidentID on the incidentsByContact report reportDataCell.GenericValue = "_" + colValue[heading]; break; } reportDataRow.Cells.Add(reportDataCell); } reportRows.Add(reportDataRow); } catch (Exception ex) { string errMsg = "rnow_incidentsByContact report columns Heading: " + heading + " is missing"; MessageBox.Show(errMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); string logMessage = errMsg; ConfigurationSetting.logWrap.ErrorLog(logMessage: logMessage); throw ex; } }
// add Right Now Incident report row private void addRnowIncidentRow(ref IList <string> columns, ref ReportDataRow reportDataRow, ref IList <IReportRow> reportRows, ref Hashtable srHashtable, Dictionary <string, string> colValue) { string heading = null; string dateTimeString = null; try { foreach (var column in columns) { ReportDataCell reportDataCell = new ReportDataCell(); switch (column) { case "Siebel$SRlistTable.SrNumber": heading = "SIEBEL_SR_NUM"; reportDataCell.GenericValue = colValue[heading]; if (!String.IsNullOrEmpty(colValue[heading])) { srHashtable.Add(colValue[heading], true); } break; case "Siebel$SRlistTable.IncidentRef": heading = "REFERENCE #"; reportDataCell.GenericValue = colValue[heading]; break; case "Siebel$SRlistTable.Created": heading = "DATE CREATED"; dateTimeString = colValue[heading]; // remove the single ' dateTimeString = dateTimeString.TrimStart('\''); dateTimeString = dateTimeString.TrimEnd('\''); reportDataCell.GenericValue = Convert.ToDateTime(dateTimeString); break; case "Siebel$SRlistTable.Summary": heading = "SUBJECT"; reportDataCell.GenericValue = colValue[heading]; break; case "Siebel$SRlistTable.Status": heading = "STATUS"; reportDataCell.GenericValue = colValue[heading]; break; case "Siebel$SRlistTable.HiddenSRconcatIncident_ID": heading = "INCIDENT ID"; // colValue[5] is hiddent IncidentID on the incidentsByContact report reportDataCell.GenericValue = "_" + colValue[heading]; break; } reportDataRow.Cells.Add(reportDataCell); } reportRows.Add(reportDataRow); } catch (Exception ex) { string errMsg = "rnow_incidentsByContact report columns Heading: " + heading + " is missing"; MessageBox.Show(errMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); string logMessage = errMsg; ConfigurationSetting.logWrap.ErrorLog(logMessage: logMessage); throw ex; } }
// Add Siebel Service Request row private void addSiebelSrRow(ref IList<string> columns, ref ReportDataRow reportDataRow, ref IList<IReportRow> reportRows, Hashtable srHashtable, ServiceRequest req) { bool srInRnow = false; foreach (var column in columns) { ReportDataCell reportDataCell = new ReportDataCell(); switch (column) { case "Siebel$SRlistTable.SrNumber": reportDataCell.GenericValue = req.RequestNumber; if (srHashtable.ContainsKey(req.RequestNumber)) srInRnow = true; break; case "Siebel$SRlistTable.Status": reportDataCell.GenericValue = req.Status; break; case "Siebel$SRlistTable.Summary": reportDataCell.GenericValue = req.Summary; break; case "Siebel$SRlistTable.Created": reportDataCell.GenericValue = req.RequestDate; break; case "Siebel$SRlistTable.IncidentRef": reportDataCell.GenericValue = ""; break; case "Siebel$SRlistTable.HiddenSRconcatIncident_ID": reportDataCell.GenericValue = req.RequestID + "_"; break; } reportDataRow.Cells.Add(reportDataCell); } if (!srInRnow) { reportRows.Add(reportDataRow); srInRnow = false; } }
protected void addItem(ref IList<string> columns, ref ReportDataRow reportDataRow, ref IList<IReportRow> reportRows, IReport item) { foreach (var column in columns) { ReportDataCell reportDataCell = new ReportDataCell(); Tuple<ReportColumnType, object> field = item.getVirtualColumnValue(column.Replace(this.Parent.Name + "$" + this.Name + ".", "")); ReportColumnType type = field.Item1; switch (type) { case ReportColumnType.Integer: reportDataCell.GenericValue = Convert.ToInt32(field.Item2); break; case ReportColumnType.String: reportDataCell.GenericValue = Convert.ToString(field.Item2); break; case ReportColumnType.DateTime: reportDataCell.GenericValue = Convert.ToDateTime(field.Item2); break; case ReportColumnType.Boolean: reportDataCell.GenericValue = Convert.ToBoolean(field.Item2); break; } reportDataRow.Cells.Add(reportDataCell); } reportRows.Add(reportDataRow); }
// used by SR and Contact Details, and null check before doing Convert. protected void addDetailRow(Dictionary<string, string> dictDetail, ref IList<string> columns, ref ReportDataRow reportDataRow, ref IList<IReportRow> reportRows) { foreach (string column in columns) { ReportDataCell reportDataCell = new ReportDataCell(); // put the "Siebel$SRDetailTable." package name back, that's required by the report framework string pkgNtblName = "Siebel$" + this.Name + "."; string removePkgTblName = column.Replace(pkgNtblName, ""); string[] typeValArray = Regex.Split(dictDetail[removePkgTblName], TYPE_VALUE_DELIMITER); string type = typeValArray[0]; string val = typeValArray[1]; switch (type) { case "String": reportDataCell.GenericValue = val; break; case "Integer": if (val != null && val != "") reportDataCell.GenericValue = Convert.ToInt32(val); else reportDataCell.GenericValue = null; break; case "DateTime": if (val != null && val != "" && !val.Contains("1/1/0001")) reportDataCell.GenericValue = Convert.ToDateTime(val); else reportDataCell.GenericValue = null; break; case "Boolean": if (val != null && val != "") reportDataCell.GenericValue = Convert.ToBoolean(val); else reportDataCell.GenericValue = null; break; } reportDataRow.Cells.Add(reportDataCell); } reportRows.Add(reportDataRow); }