private void DatebookMoneyReport_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { xpcDatebookProfitCollection.Criteria = CriteriaOperator.Parse("[DatebookOwner].[Date] Between(?, ?)", BeginDate.Value, EndDate.Value); xpcDatebookCostCollection.Criteria = CriteriaOperator.Parse("[DatebookOwner].[Date] Between(?, ?)", BeginDate.Value, EndDate.Value); RecordSum.GenerateTableSum <ProfitType>(DatebookProfitSum, xpcDatebookProfitCollection, "Profit", "ProfitTypeID", "ProfitTypeCaption"); RecordSum.GenerateTableSum <CostType>(DatebookCostSum, xpcDatebookCostCollection, "Cost", "CostTypeID", "CostTypeCaption"); //DatebookCostSum.OrderBy(Sum => Sum); //DatebookCostSum.Sort(); //DatebookCostSum.Reverse(); }
private void DatebookMoneyReport_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { if ((bool)Clean.Value) { xpcDatebookProfitCollection.Criteria = CriteriaOperator.Parse("[DatebookOwner].[Date] Between(?, ?) && [ProfitTypeID].[Clean]", BeginDate.Value, EndDate.Value); } else { xpcDatebookProfitCollection.Criteria = CriteriaOperator.Parse("[DatebookOwner].[Date] Between(?, ?)", BeginDate.Value, EndDate.Value); } RecordSum.GenerateTableSum <ProfitType>(datebookProfitSum, xpcDatebookProfitCollection, "Profit", "ProfitTypeID", "ProfitTypeCaption"); monthCount = ((DateTime)EndDate.Value).Subtract((DateTime)BeginDate.Value).Days / (365.25 / 12); }