public static MyReportBase ConvertReportToMyReportBase(this XtraReport report) { if (report == null) return null; // return, do not convert if input is already myReportBase var convertReportToMyReportBase = report as MyReportBase; if (convertReportToMyReportBase != null) return convertReportToMyReportBase; var stream = new MemoryStream(); report.SaveLayout(stream); stream.Position = 0; var newReport = new MyReportBase(); newReport.LoadLayout(stream); newReport.DataSource = report.DataSource; return newReport; }