protected override void ReadChildXml(XmlReader p_reader) { switch (p_reader.Name) { case "Text": Item.ReadXml(p_reader); break; case "Subtotal": if (SubTotals == null) { SubTotals = new List <RptMtxSubtotal>(); } RptMtxSubtotal sub = new RptMtxSubtotal(this); sub.ReadXml(p_reader); SubTotals.Add(sub); break; case "Subtitle": if (SubTitles == null) { SubTitles = new List <RptMtxSubtitle>(); } RptMtxSubtitle title = new RptMtxSubtitle(this); title.ReadXml(p_reader); SubTitles.Add(title); break; } }
public void EvaluateSubTotals() { Months.Clear(); Totals.Clear(); for (var index = 0; index <= _diffMonths; index++) { var period = _from.AddMonths(index); var ordersInMonth = _orders.Where(IsInMonth(period.Month)); Months.Add(period.ToString(MonthFormat)); SubTotals.Add(ordersInMonth.Sum(order => order.SubTotal)); } }
public void EvaluateTotals() { if (!SubTotals.Any()) // SubTotals need to be evaluated beforehand { EvaluateSubTotals(); } Totals.Clear(); for (var index = 0; index <= _diffMonths; index++) { var period = _from.AddMonths(index); var ordersInMonth = _orders.Where(IsInMonth(period.Month)); Totals.Add(ordersInMonth.Sum(order => order.OrderTotal)); } }
private void ExecSubTotal() { // 그룹우선순위기준:A가 더큰 범위이다 // DB 정렬은 A,B ASC // InitGrid는 A,B 순서 // flex.Unbinding = dt; // ExecSubTotal 은 B(XXSUB2),A(XXSUB1) // 컬럼명[UserData] // 소계: XXSUB1 누계:XXACC1 총계 :XXGRA0 _flexM.Redraw = false; // 금액을 나타낼 컬럼지정 List <string> sumList = new List <string>(); sumList.Add("AM_1");// sumList.Add("AM_2"); SubTotals sts = new SubTotals(); sts.FirstRow = _flexM.Rows.Fixed + 2; //첫 행은 제외하기 위해 SubTotal st = null; //소계 st = sts.NewTotal(); st.Type = TotalEnum.SubTotal; st.GroupCol = _flexM.Cols["actyear"].Index; st.TotalColName = sumList.ToArray(); sts.Add(st); _flexM.DoSubTotal(sts); for (int i = _flexM.Rows.Fixed + 2; i < _flexM.Rows.Count; i++) { //그룹화된 행여부가져오기. true이면 그룹화된 행이다 if (_flexM.Rows[i].IsNode) { //UserData 컬럼에 해당 그룹행 명칭이 지정된다. switch (D.GetString(_flexM.Rows[i].UserData).Substring(0, 6)) { case "XXSUB1": _flexM[i, "actyear"] = "소계월"; break; } } } }
private static decimal CalculateTotal(SubTotals subTotals) { return(subTotals.Sum()); }
public SubTotals Resolve(TSource source, TDestination destination, SubTotals destMember, ResolutionContext context) { return(ProperyResolverFactory.Resolve <TSource, TDestination, SubTotals>(source, destination, "SubTotals") as SubTotals); }