// add the columns dynamically protected void addColumns(Dictionary <string, ReportColumnType> dictDetail) { foreach (KeyValuePair <string, ReportColumnType> entry in dictDetail) { ReportColumn reportCol = new ReportColumn(); reportCol.Name = entry.Key; reportCol.Label = entry.Key; reportCol.CanDisplay = true; reportCol.CanFilter = false; reportCol.DataType = entry.Value; this.Columns.Add(reportCol); } }
// add the columns dynamically for order management tables (can be backported for other tables) protected void addColumns(Type tableInfo) { foreach (PropertyInfo propertyInfo in tableInfo.GetProperties()) { if (propertyInfo.PropertyType.Name == "Boolean" && propertyInfo.Name.EndsWith("Specified")) { continue; } else { ReportColumn reportCol = new ReportColumn(); reportCol.Name = propertyInfo.Name; reportCol.Label = propertyInfo.Name; reportCol.CanDisplay = true; reportCol.CanFilter = true; switch (propertyInfo.PropertyType.Name) { case "Nullable`1": // because of System.Nullable<generic> string nullableType = propertyInfo.PropertyType.GetGenericArguments()[0].ToString(); if (nullableType == "System.Decimal") { reportCol.DataType = ReportColumnType.Integer; } else if (nullableType == "System.DateTime") { reportCol.DataType = ReportColumnType.DateTime; } break; case "String": reportCol.DataType = ReportColumnType.String; break; case "Boolean": reportCol.DataType = ReportColumnType.Boolean; break; } this.Columns.Add(reportCol); } } }
// add the columns dynamically protected void addColumns(Dictionary<string, ReportColumnType> dictDetail) { foreach (KeyValuePair<string, ReportColumnType> entry in dictDetail) { ReportColumn reportCol = new ReportColumn(); reportCol.Name = entry.Key; reportCol.Label = entry.Key; reportCol.CanDisplay = true; reportCol.CanFilter = false; reportCol.DataType = entry.Value; this.Columns.Add(reportCol); } }
// add the columns dynamically protected void addColumns(Dictionary<string, string> dictDetail) { foreach (KeyValuePair<string, string> entry in dictDetail) { ReportColumn reportCol = new ReportColumn(); string type = (Regex.Split (entry.Value,TYPE_VALUE_DELIMITER))[0]; reportCol.Name = entry.Key; reportCol.Label = entry.Key; reportCol.CanDisplay = true; reportCol.CanFilter = true; switch (type) { case "Integer": reportCol.DataType = ReportColumnType.Integer; break; case "String": reportCol.DataType = ReportColumnType.String; break; case "DateTime": reportCol.DataType = ReportColumnType.DateTime; break; case "Boolean": reportCol.DataType = ReportColumnType.Boolean; break; } this.Columns.Add(reportCol); } }
// add the columns dynamically for order management tables (can be backported for other tables) protected void addColumns(Type tableInfo) { foreach (PropertyInfo propertyInfo in tableInfo.GetProperties()) { if (propertyInfo.PropertyType.Name == "Boolean" && propertyInfo.Name.EndsWith("Specified")) continue; else { ReportColumn reportCol = new ReportColumn(); reportCol.Name = propertyInfo.Name; reportCol.Label = propertyInfo.Name; reportCol.CanDisplay = true; reportCol.CanFilter = true; switch (propertyInfo.PropertyType.Name) { case "Nullable`1": // because of System.Nullable<generic> string nullableType = propertyInfo.PropertyType.GetGenericArguments()[0].ToString(); if (nullableType == "System.Decimal") reportCol.DataType = ReportColumnType.Integer; else if (nullableType == "System.DateTime") reportCol.DataType = ReportColumnType.DateTime; break; case "String": reportCol.DataType = ReportColumnType.String; break; case "Boolean": reportCol.DataType = ReportColumnType.Boolean; break; } this.Columns.Add(reportCol); } } }