/// <summary> /// capture the data of the screen to a DataItemReport class. /// </summary> /// <param name="Defn"></param> /// <param name="Content"></param> /// <returns></returns> public static DataItemReport CaptureToReport(this IScreenDefn Defn, ScreenContent Content) { ISectionHeader sectionHeader = Defn as ISectionHeader; var start = new OneScreenLoc(1, 1); var itemReport = sectionHeader.CaptureToReport(start, Content); return(itemReport); }
/// <summary> /// capture the data of the screen to a DataTable class. /// </summary> /// <param name="Defn"></param> /// <param name="Content"></param> /// <returns></returns> public static EnhancedDataTable Capture( this IScreenDefn Defn, ScreenContent Content, ScreenItemInstance ItemInstance = null) { ISectionHeader sectionHeader = Defn as ISectionHeader; var start = new OneScreenLoc(1, 1); var report = sectionHeader.CaptureToReport(start, Content); var table = report.ToDataTable(); // mark the selected datarow in the dataTable. int rownum = 0; if ((ItemInstance != null) && (ItemInstance.RepeatNum > 0)) { rownum = ItemInstance.RepeatNum - 1; } table.MarkSelectedRow(rownum); return(table); }