private IList <KeyValuePair <XRTable, List <XRTable> > > FindTables(DevExpress.XtraReports.UI.XtraReport xtraReport) { var result = new List <KeyValuePair <XRTable, List <XRTable> > >(); IEnumerable <XRTable> allTables = xtraReport.AllControls <XRTable>().Where(t => t.Visible); foreach (var table in allTables) { var subResult = new List <XRTable>(); XRTableCellCollection dataCells = table.Rows[0].Cells; bool match = true; IEnumerable <XRTable> candidates = allTables.Where(t => t.Visible && t != table); foreach (var candidate in candidates) { if (candidate.Rows[0].Cells.Count == dataCells.Count) { XRTableCellCollection cells = candidate.Rows[0].Cells; for (int i = 0; i < cells.Count; i++) { match &= FloatComparer.Compare(dataCells[i].WidthF, candidate.Rows[0].Cells[i].WidthF, 5) == 0; } if (match) { subResult.Add(candidate); } } } result.Add(new KeyValuePair <XRTable, List <XRTable> >(table, subResult)); } return(result); }