ResultCell[] GetResultCells(ReportElement[] elements, ResultCell[] row, ResultCell[] col) { ResultCell[] result = new ResultCell[elements.Length]; for (int i = 0; i < elements.Length; i++) { ResultCell val = row.FirstOrDefault(v => v.Element == elements[i]); if (val == null) val = col.FirstOrDefault(v => v.Element == elements[i]); result[i] = new ResultCell() { Element = elements[i], Value = val.Value }; } return result.ToArray(); }
ResultCell[] GetResultCells(ReportElement[] elements, DataRow row) { ResultCell[] result = new ResultCell[elements.Length]; for (int i = 0; i < elements.Length; i++) { result[i] = new ResultCell() { Element = elements[i], Value = row[elements[i].SQLColumnName] }; } return result.ToArray(); }