public static object GetTotal(Dictionary dictionary, string name) { Total sum = dictionary.Totals.FindByName(name); if (sum != null) { return(sum.Value); } return(null); }
internal void StartKeep() { if (!IsPageFooter || keeping) { return; } keeping = true; keepTotal = Clone(); }
internal object GetValue(string name) { Total t = FindByName(name); if (t == null) { throw new UnknownNameException(name); } return(t.Value); }
internal void ResetValue() { if (IsInsideHierarchy) { Total subTotal = FindSubTotal(subPrefix + Report.Engine.HierarchyLevel.ToString()); subTotal.ResetValue(); return; } Clear(); }
private Total FindSubTotal(string name) { Total result = subTotals.FindByName(name); if (result == null) { result = this.Clone(); result.Name = name; subTotals.Add(result); } return(result); }
internal Total Clone() { Total total = new Total(); total.SetReport(Report); total.TotalType = TotalType; total.Expression = Expression; total.Evaluator = Evaluator; total.PrintOn = PrintOn; total.ResetAfterPrint = ResetAfterPrint; total.ResetOnReprint = ResetOnReprint; total.EvaluateCondition = EvaluateCondition; total.IncludeInvisibleRows = IncludeInvisibleRows; return(total); }
internal void AddValue() { if (IsInsideHierarchy) { Total subTotal = FindSubTotal(subPrefix + Report.Engine.HierarchyLevel.ToString()); subTotal.AddValue(); return; } if (!Evaluator.Visible && !IncludeInvisibleRows) { return; } if (!String.IsNullOrEmpty(EvaluateCondition) && (bool)Report.Calc(EvaluateCondition) == false) { return; } if (TotalType != TotalType.Count && String.IsNullOrEmpty(Expression)) { return; } if (keeping) { keepTotal.AddValue(); return; } // if Total refers to another total Total total = IsRefersToTotal(); if (total != null) { if (!total.parentTotal.Contains(this)) { total.parentTotal.Add(this); } return; } object value = TotalType == TotalType.Count ? null : Report.Calc(Expression); AddValue(value); if (TotalType != TotalType.Avg || (value != null && !(value is DBNull))) { count++; } }
/// <inheritdoc/> public override void Serialize(FRWriter writer) { Total c = writer.DiffObject as Total; base.Serialize(writer); if (TotalType != c.TotalType) { writer.WriteValue("TotalType", TotalType); } if (Expression != c.Expression) { writer.WriteStr("Expression", Expression); } if (Evaluator != c.Evaluator) { writer.WriteRef("Evaluator", Evaluator); } if (PrintOn != c.PrintOn) { writer.WriteRef("PrintOn", PrintOn); } if (ResetAfterPrint != c.ResetAfterPrint) { writer.WriteBool("ResetAfterPrint", ResetAfterPrint); } if (ResetOnReprint != c.ResetOnReprint) { writer.WriteBool("ResetOnReprint", ResetOnReprint); } if (EvaluateCondition != c.EvaluateCondition) { writer.WriteStr("EvaluateCondition", EvaluateCondition); } if (IncludeInvisibleRows != c.IncludeInvisibleRows) { writer.WriteBool("IncludeInvisibleRows", IncludeInvisibleRows); } }
private object GetValue() { if (IsInsideHierarchy) { Total subTotal = FindSubTotal(subPrefix + Report.Engine.HierarchyLevel.ToString()); return(subTotal.Value); } if (TotalType == TotalType.Avg) { if (value == null || count == 0) { return(null); } return(new Variant(value) / count); } else if (TotalType == TotalType.Count) { return(count); } return(value); }
internal void AddValue() { if (IsInsideHierarchy) { Total subTotal = FindSubTotal(subPrefix + Report.Engine.HierarchyLevel.ToString()); subTotal.AddValue(); return; } if (!Evaluator.Visible && !IncludeInvisibleRows) { return; } if (!String.IsNullOrEmpty(EvaluateCondition) && (bool)Report.Calc(EvaluateCondition) == false) { return; } if (TotalType != TotalType.Count && String.IsNullOrEmpty(Expression)) { return; } if (FKeeping) { FKeepTotal.AddValue(); return; } object value = TotalType == TotalType.Count ? null : Report.Calc(Expression); AddValue(value); if (TotalType != TotalType.Avg || (value != null && !(value is DBNull))) { FCount++; } }
public static bool IsValidTotal(Dictionary dictionary, string name) { Total sum = dictionary.Totals.FindByName(name); return(sum != null); }