public override void SetView(ExControlView i_View) { this.Headers.txtEdit = this.txtCell; if (i_View == null || !(i_View is IMultiHeader)) { return; } _ExControlView = i_View; IMultiHeader mainView = i_View as IMultiHeader; if (i_View.PrintingTable == null) { return; } int colcount = i_View.PrintingTable.GetColumns(); colcount = colcount <= 0?0:colcount; if (mainView.HeadersData == null) { this.Headers = new HeadersData(0, colcount); } else { this.Headers = mainView.HeadersData.Copy(); int count = colcount - this.Headers.ColCount; for (int i = 0; i < count; i++) { this.Headers.AddCol(); } for (int i = count; i < 0; i++) { this.Headers.RemoveCol(); } } this.LayoutHeaders(); }
public HorizonGroupView(SerializationInfo info, StreamingContext context) : base(info, context) { try { _RootGroupInfo = (Webb.Reports.ExControls.Data.GroupInfo)info.GetValue("_RootGroupInfo", typeof(Webb.Reports.ExControls.Data.GroupInfo)); } catch { } try { _Fitler = (Webb.Data.DBFilter)info.GetValue("_Fitler", typeof(Webb.Data.DBFilter)); } catch { } try { _ShowRowIndicators = info.GetBoolean("_ShowRowIndicators"); } catch { _ShowRowIndicators = false; } try { _HaveHeader = info.GetBoolean("_HaveHeader"); } catch { _HaveHeader = true; } try { _ColumnsWidth = (Webb.Collections.Int32Collection)info.GetValue("_ColumnsWidth", typeof(Webb.Collections.Int32Collection)); } catch { } try { _RowsHight = (Webb.Collections.Int32Collection)info.GetValue("_RowsHight", typeof(Webb.Collections.Int32Collection)); } catch { } try { _Total = info.GetBoolean("_Total"); } catch { _Total = true; } try { _HorizonTopCount = info.GetInt32("_HorizonTopCount"); } catch { _HorizonTopCount = 0; } try { _TotalOthers = info.GetBoolean("_TotalOthers"); } catch { _TotalOthers = false; } try { _TotalOthersName = info.GetString("_TotalOthersName"); } catch { _TotalOthersName = "Others"; } try { _TotalStyle = (Webb.Reports.ExControls.BasicStyle)info.GetValue("_TotalStyle", typeof(Webb.Reports.ExControls.BasicStyle)); } catch { _TotalStyle = new BasicStyle(); } try { _HeaderRows = (Webb.Collections.Int32Collection)info.GetValue("_HeaderRows", typeof(Webb.Collections.Int32Collection)); } catch { _HeaderRows = new Int32Collection(); } try { TableHeaders = (Webb.Reports.ExControls.Data.HeadersData)info.GetValue("TableHeaders", typeof(Webb.Reports.ExControls.Data.HeadersData)); } catch { TableHeaders = null; } try { _TotalPosition = (Webb.Data.TotalType)info.GetValue("_TotalPosition", typeof(Webb.Data.TotalType)); } catch { if (_RootGroupInfo != null && _RootGroupInfo.AddTotal) { _TotalPosition = TotalType.AllBefore; _RootGroupInfo.AddTotal = false; } else { _TotalPosition = TotalType.None; } if (RootGroupInfo != null) { if (RootGroupInfo.SubGroupInfos.Count > 0 && RootGroupInfo.Summaries != null) { RootGroupInfo.SubGroupInfos[0].Summaries = RootGroupInfo.Summaries.CopyStructure(); } RootGroupInfo.Summaries = new GroupSummaryCollection(); if (this.Total) { GroupSummary groupSummary = new GroupSummary(); groupSummary.ColorNeedChange = true; groupSummary.Style.SetStyle(this.TotalStyle); groupSummary.ShowZeros = true; RootGroupInfo.Summaries.Add(groupSummary); } } } try { _TotalOthersPosition = (Webb.Data.TotalType)info.GetValue("_TotalOthersPosition", typeof(Webb.Data.TotalType)); } catch { if (this._TotalOthers) { _TotalOthersPosition = TotalType.AllAfter; } else { _TotalOthersPosition = TotalType.None; } } try { _SummaryForTotalGroup = (Webb.Reports.ExControls.Data.GroupSummary)info.GetValue("_SummaryForTotalGroup", typeof(Webb.Reports.ExControls.Data.GroupSummary)); } catch { _SummaryForTotalGroup = new GroupSummary(); } try { _SummaryForOthers = (Webb.Reports.ExControls.Data.GroupSummary)info.GetValue("_SummaryForOthers", typeof(Webb.Reports.ExControls.Data.GroupSummary)); } catch { _SummaryForOthers = new GroupSummary(); } }
public GradingView(SerializationInfo info, StreamingContext context) : base(info, context) { try { _GradingSectionCollection = (Webb.Reports.ExControls.Data.GradingSectionCollection)info.GetValue("_GradingSectionCollection", typeof(Webb.Reports.ExControls.Data.GradingSectionCollection)); } catch { _GradingSectionCollection = new GradingSectionCollection(); } try { _RootGroupInfo = (Webb.Reports.ExControls.Data.GroupInfo)info.GetValue("_RootGroupInfo", typeof(Webb.Reports.ExControls.Data.GroupInfo)); } catch { _RootGroupInfo = new FieldGradingInfo(); } try { _CellSizeAutoAdapting = (Webb.Reports.ExControls.Views.CellSizeAutoAdaptingTypes)info.GetValue("_CellSizeAutoAdapting", typeof(Webb.Reports.ExControls.Views.CellSizeAutoAdaptingTypes)); } catch { _CellSizeAutoAdapting = CellSizeAutoAdaptingTypes.NotUse; } try { _Filter = (Webb.Data.DBFilter)info.GetValue("_Filter", typeof(Webb.Data.DBFilter)); } catch { _Filter = new Webb.Data.DBFilter(); } try { _TopCount = info.GetInt32("_TopCount"); } catch { _TopCount = 0; } try { _ShowRowIndicators = info.GetBoolean("_ShowRowIndicators"); } catch { _ShowRowIndicators = false; } try { _HaveHeader = info.GetBoolean("_HaveHeader"); } catch { _HaveHeader = true; } try { _SectionInOneRow = info.GetBoolean("_SectionInOneRow"); } catch { _SectionInOneRow = true; } try { _HeaderRows = (Webb.Collections.Int32Collection)info.GetValue("_HeaderRows", typeof(Webb.Collections.Int32Collection)); } catch { _HeaderRows = new Int32Collection(); } try { _SectionRows = (Webb.Collections.Int32Collection)info.GetValue("_SectionRows", typeof(Webb.Collections.Int32Collection)); } catch { _SectionRows = new Int32Collection(); } try { _TotalRows = (Webb.Collections.Int32Collection)info.GetValue("_TotalRows", typeof(Webb.Collections.Int32Collection)); } catch { _TotalRows = new Int32Collection(); } try { _ColumnsWidth = (Webb.Collections.Int32Collection)info.GetValue("_ColumnsWidth", typeof(Webb.Collections.Int32Collection)); } catch { _ColumnsWidth = new Int32Collection(); } try { _RowsHight = (Webb.Collections.Int32Collection)info.GetValue("_RowsHight", typeof(Webb.Collections.Int32Collection)); } catch { _RowsHight = new Int32Collection(); } try { _Styles = (Webb.Reports.ExControls.Styles.ExControlStyles)info.GetValue("_Styles", typeof(Webb.Reports.ExControls.Styles.ExControlStyles)); } catch { _Styles = new ExControlStyles(); } try { _HeadersData = (HeadersData)info.GetValue("_HeadersData", typeof(Webb.Reports.ExControls.Data.HeadersData)); } catch { _HeadersData = null; } try { _OurBordersSetting = (Webb.Reports.ExControls.Views.OurBordersSetting)info.GetValue("_OurBordersSetting", typeof(Webb.Reports.ExControls.Views.OurBordersSetting)); } catch { _OurBordersSetting = new OurBordersSetting(); } }