/// <inheritdoc/> public virtual void Serialize(FRWriter writer) { MatrixDescriptor c = writer.DiffObject as MatrixDescriptor; if (Expression != c.Expression) { writer.WriteStr("Expression", Expression); } }
public MatrixHelper(MatrixObject matrix) { this.matrix = matrix; titleDescriptor = new MatrixDescriptor(); cellHeaderDescriptor = new MatrixDescriptor(); cellHeaderDescriptor.Expression = "Data"; noColumnsDescriptor = new MatrixHeaderDescriptor("", false); noRowsDescriptor = new MatrixHeaderDescriptor("", false); noCellsDescriptor = new MatrixCellDescriptor(); }
public MatrixHelper(MatrixObject matrix) { FMatrix = matrix; FTitleDescriptor = new MatrixDescriptor(); FCellHeaderDescriptor = new MatrixDescriptor(); FCellHeaderDescriptor.Expression = "Data"; FNoColumnsDescriptor = new MatrixHeaderDescriptor("", false); FNoRowsDescriptor = new MatrixHeaderDescriptor("", false); FNoCellsDescriptor = new MatrixCellDescriptor(); }
/// <inheritdoc/> public override void Assign(MatrixDescriptor source) { base.Assign(source); MatrixCellDescriptor src = source as MatrixCellDescriptor; if (src != null) { Function = src.Function; Percent = src.Percent; } }
public MatrixCellSmartTag(MatrixObject matrix, MatrixDescriptor descriptor) : base(descriptor.TemplateCell) { FMatrix = matrix; FDescriptor = descriptor; string expression = descriptor.Expression; if (expression.StartsWith("[") && expression.EndsWith("]")) { expression = expression.Substring(1, expression.Length - 2); } DataColumn = expression; }
/// <inheritdoc/> public override void Assign(MatrixDescriptor source) { base.Assign(source); MatrixHeaderDescriptor src = source as MatrixHeaderDescriptor; if (src != null) { Sort = src.Sort; Totals = src.Totals; TotalsFirst = src.TotalsFirst; PageBreak = src.PageBreak; SuppressTotals = src.SuppressTotals; TemplateTotalCell = src.TemplateTotalCell; } }
public MatrixHeaderMenu(MatrixObject matrix, MatrixElement element, MatrixDescriptor descriptor) : base(matrix, element, descriptor) { MyRes res = new MyRes("ComponentMenu,MatrixCell"); miSort = CreateMenuItem(null, Res.Get("Forms,DataBandEditor,Sort"), null); miSortAsc = CreateMenuItem(null, Res.Get("Forms,GroupBandEditor,Ascending"), Sort_Click); miSortAsc.AutoCheckOnClick = true; miSortAsc.Tag = SortOrder.Ascending; miSortDesc = CreateMenuItem(null, Res.Get("Forms,GroupBandEditor,Descending"), Sort_Click); miSortDesc.AutoCheckOnClick = true; miSortDesc.Tag = SortOrder.Descending; miSortNone = CreateMenuItem(null, Res.Get("Forms,GroupBandEditor,NoSort"), Sort_Click); miSortNone.AutoCheckOnClick = true; miSortNone.Tag = SortOrder.None; miTotals = CreateMenuItem(null, res.Get("Totals"), miTotals_Click); miTotals.AutoCheckOnClick = true; miPageBreak = CreateMenuItem(null, Res.Get("ComponentMenu,Band,StartNewPage"), miPageBreak_Click); miPageBreak.AutoCheckOnClick = true; miSuppressTotals = CreateMenuItem(null, res.Get("SuppressTotals"), miSuppressTotals_Click); miSuppressTotals.AutoCheckOnClick = true; miTotalsFirst = CreateMenuItem(null, res.Get("TotalsFirst"), miTotalsFirst_Click); miTotalsFirst.AutoCheckOnClick = true; miSort.SubItems.AddRange(new BaseItem[] { miSortAsc, miSortDesc, miSortNone }); int insertIndex = Items.IndexOf(miDelete); Items.Insert(insertIndex, miSort); Items.Insert(insertIndex + 1, miTotals); Items.Insert(insertIndex + 2, miPageBreak); Items.Insert(insertIndex + 3, miSuppressTotals); Items.Insert(insertIndex + 4, miTotalsFirst); SortOrder sort = (Descriptor as MatrixHeaderDescriptor).Sort; miSortAsc.Checked = sort == SortOrder.Ascending; miSortDesc.Checked = sort == SortOrder.Descending; miSortNone.Checked = sort == SortOrder.None; miTotals.Checked = (Descriptor as MatrixHeaderDescriptor).Totals; miTotals.Enabled = !matrix.IsAncestor; miPageBreak.Checked = (Descriptor as MatrixHeaderDescriptor).PageBreak; miSuppressTotals.Checked = (Descriptor as MatrixHeaderDescriptor).SuppressTotals; miTotalsFirst.Checked = (Descriptor as MatrixHeaderDescriptor).TotalsFirst; }
public MatrixCellMenuBase(MatrixObject matrix, MatrixElement element, MatrixDescriptor descriptor) : base(matrix.Report.Designer) { FMatrix = matrix; FElement = element; FDescriptor = descriptor; miEdit = CreateMenuItem(null, Res.Get("ComponentMenu,Component,Edit"), new EventHandler(miEdit_Click)); miFormat = CreateMenuItem(Res.GetImage(168), Res.Get("ComponentMenu,TextObject,Format"), new EventHandler(miFormat_Click)); miHyperlink = CreateMenuItem(Res.GetImage(167), Res.Get("ComponentMenu,ReportComponent,Hyperlink"), new EventHandler(miHyperlink_Click)); miDelete = CreateMenuItem(Res.GetImage(51), Res.Get("Designer,Menu,Edit,Delete"), new EventHandler(miDelete_Click)); miDelete.BeginGroup = true; Items.AddRange(new BaseItem[] { miEdit, miFormat, miHyperlink, miDelete }); bool enabled = Designer.SelectedObjects.Count == 1; miEdit.Enabled = enabled; miDelete.Enabled = enabled && descriptor != null && !matrix.IsAncestor; }
public MatrixTotalMenu(MatrixObject matrix, MatrixElement element, MatrixDescriptor descriptor) : base(matrix, element, descriptor) { }
public MatrixCellMenu(MatrixObject matrix, MatrixElement element, MatrixDescriptor descriptor) : base(matrix, element, descriptor) { MyRes res = new MyRes("Forms,TotalEditor"); miFunction = CreateMenuItem(Res.GetImage(132), Res.Get("ComponentMenu,MatrixCell,Function"), null); miFunctionNone = CreateMenuItem(null, Res.Get("Misc,None"), new EventHandler(Function_Click)); miFunctionNone.AutoCheckOnClick = true; miFunctionNone.Tag = MatrixAggregateFunction.None; miFunctionSum = CreateMenuItem(null, res.Get("Sum"), new EventHandler(Function_Click)); miFunctionSum.AutoCheckOnClick = true; miFunctionSum.Tag = MatrixAggregateFunction.Sum; miFunctionMin = CreateMenuItem(null, res.Get("Min"), new EventHandler(Function_Click)); miFunctionMin.AutoCheckOnClick = true; miFunctionMin.Tag = MatrixAggregateFunction.Min; miFunctionMax = CreateMenuItem(null, res.Get("Max"), new EventHandler(Function_Click)); miFunctionMax.AutoCheckOnClick = true; miFunctionMax.Tag = MatrixAggregateFunction.Max; miFunctionAvg = CreateMenuItem(null, res.Get("Avg"), new EventHandler(Function_Click)); miFunctionAvg.AutoCheckOnClick = true; miFunctionAvg.Tag = MatrixAggregateFunction.Avg; miFunctionCount = CreateMenuItem(null, res.Get("Count"), new EventHandler(Function_Click)); miFunctionCount.AutoCheckOnClick = true; miFunctionCount.Tag = MatrixAggregateFunction.Count; miFunctionCustom = CreateMenuItem(null, res.Get("Custom"), new EventHandler(Function_Click)); miFunctionCustom.AutoCheckOnClick = true; miFunctionCustom.Tag = MatrixAggregateFunction.Custom; miFunction.SubItems.AddRange(new BaseItem[] { miFunctionNone, miFunctionSum, miFunctionMin, miFunctionMax, miFunctionAvg, miFunctionCount, miFunctionCustom }); res = new MyRes("ComponentMenu,MatrixCell"); miPercent = CreateMenuItem(null, res.Get("Percent"), null); miPercentNone = CreateMenuItem(null, Res.Get("Misc,None"), new EventHandler(Percent_Click)); miPercentNone.AutoCheckOnClick = true; miPercentNone.Tag = MatrixPercent.None; miPercentColumnTotal = CreateMenuItem(null, res.Get("PercentColumnTotal"), new EventHandler(Percent_Click)); miPercentColumnTotal.AutoCheckOnClick = true; miPercentColumnTotal.Tag = MatrixPercent.ColumnTotal; miPercentRowTotal = CreateMenuItem(null, res.Get("PercentRowTotal"), new EventHandler(Percent_Click)); miPercentRowTotal.AutoCheckOnClick = true; miPercentRowTotal.Tag = MatrixPercent.RowTotal; miPercentGrandTotal = CreateMenuItem(null, res.Get("PercentGrandTotal"), new EventHandler(Percent_Click)); miPercentGrandTotal.AutoCheckOnClick = true; miPercentGrandTotal.Tag = MatrixPercent.GrandTotal; miPercent.SubItems.AddRange(new BaseItem[] { miPercentNone, miPercentColumnTotal, miPercentRowTotal, miPercentGrandTotal }); int insertIndex = Items.IndexOf(miDelete); Items.Insert(insertIndex, miFunction); Items.Insert(insertIndex + 1, miPercent); MatrixAggregateFunction function = (Descriptor as MatrixCellDescriptor).Function; foreach (BaseItem item in miFunction.SubItems) { if ((MatrixAggregateFunction)item.Tag == function) { (item as ButtonItem).Checked = true; break; } } MatrixPercent percent = (Descriptor as MatrixCellDescriptor).Percent; foreach (BaseItem item in miPercent.SubItems) { if ((MatrixPercent)item.Tag == percent) { (item as ButtonItem).Checked = true; break; } } }
/// <summary> /// Assigns values from another descriptor. /// </summary> /// <param name="source">Descriptor to assign values from.</param> public virtual void Assign(MatrixDescriptor source) { Expression = source.Expression; TemplateCell = source.TemplateCell; }