private RdlcReportModel GetReportModel() { Assembly assembly = this.GetType().Assembly; RdlcReportModel inst = new RdlcReportModel(); inst.Definition.EmbededReportName = "DMT.TOD.Pages.Reports.RevenueSlipSum.rdlc"; inst.Definition.RdlcInstance = RdlcReportUtils.GetEmbededReport(assembly, inst.Definition.EmbededReportName); // clear reprot datasource. inst.DataSources.Clear(); List <RevenueEntry> items = new List <RevenueEntry>(); if (null != _revenues) { items.AddRange(_revenues); } // assign new data source RdlcReportDataSource mainDS = new RdlcReportDataSource(); mainDS.Name = "main"; // the datasource name in the rdlc report. mainDS.Items = items; // setup data source // Add to datasources inst.DataSources.Add(mainDS); // Add parameters (if required). //DateTime today = DateTime.Now; //string printDate = today.ToThaiDateTimeString("dd/MM/yyyy HH:mm:ss"); //inst.Parameters.Add(RdlcReportParameter.Create("PrintDate", printDate)); return(inst); }
private RdlcReportModel GetReportModel() { Assembly assembly = this.GetType().Assembly; RdlcReportModel inst = new RdlcReportModel(); inst.Definition.EmbededReportName = "DMT.TOD.Pages.Reports.RevenueSlip.rdlc"; inst.Definition.RdlcInstance = RdlcReportUtils.GetEmbededReport(assembly, inst.Definition.EmbededReportName); // clear reprot datasource. inst.DataSources.Clear(); List <RevenueEntry> items = new List <RevenueEntry>(); if (null != _manager && null != _manager.RevenueEntry) { items.Add(_manager.RevenueEntry); } // assign new data source RdlcReportDataSource mainDS = new RdlcReportDataSource(); mainDS.Name = "main"; // the datasource name in the rdlc report. mainDS.Items = items; // setup data source // Add to datasources inst.DataSources.Add(mainDS); // Add parameters (if required). DateTime today = DateTime.Now; string printDate = today.ToThaiDateTimeString("dd/MM/yyyy HH:mm:ss"); inst.Parameters.Add(RdlcReportParameter.Create("PrintDate", printDate)); string histText = ((null != _manager && null != _manager.RevenueEntry && _manager.RevenueEntry.IsHistorical)) ? "(นำส่งย้อนหลัง)" : ""; inst.Parameters.Add(RdlcReportParameter.Create("HistoryText", histText)); return(inst); }
private RdlcReportModel GetReportModel() { Assembly assembly = this.GetType().Assembly; RdlcReportModel inst = new RdlcReportModel(); inst.Definition.EmbededReportName = "DMT.TA.Pages.Reports.CollectorCouponReceived.rdlc"; inst.Definition.RdlcInstance = RdlcReportUtils.GetEmbededReport(assembly, inst.Definition.EmbededReportName); // clear reprot datasource. inst.DataSources.Clear(); List <TSBCouponSummary> items = new List <TSBCouponSummary>(); if (null != _summary) { items.Add(_summary); } // gets coupon list by type. manager.User = _user; manager.Refresh(); // reload data. // load C35 items. List <TSBCouponTransaction> c35Items = new List <TSBCouponTransaction>(); var c35coupons = manager.C35Users; if (null != c35coupons) { c35Items.AddRange(c35coupons); } // load C80 items. List <TSBCouponTransaction> c80Items = new List <TSBCouponTransaction>(); var c80coupons = manager.C80Users; if (null != c80coupons) { c80Items.AddRange(c80coupons); } // assign new data source (main for header) RdlcReportDataSource mainDS = new RdlcReportDataSource(); mainDS.Name = "main"; // the datasource name in the rdlc report. mainDS.Items = items; // setup data source // Add to datasources inst.DataSources.Add(mainDS); // assign new data source (main for coupon35) RdlcReportDataSource c35DS = new RdlcReportDataSource(); c35DS.Name = "C35"; // the datasource name in the rdlc report. c35DS.Items = c35Items; // setup data source // Add to datasources inst.DataSources.Add(c35DS); // assign new data source (main for coupon80) RdlcReportDataSource c80DS = new RdlcReportDataSource(); c80DS.Name = "C80"; // the datasource name in the rdlc report. c80DS.Items = c80Items; // setup data source // Add to datasources inst.DataSources.Add(c80DS); // Add parameters (if required). // Coupon Received Date. DateTime today = DateTime.Today; //string couponDate = today.ToThaiDateTimeString("dd/MM/yyyy HH:mm:ss"); string couponDate = today.ToThaiDateTimeString("dd/MM/yyyy"); inst.Parameters.Add(RdlcReportParameter.Create("couponDate", couponDate)); // Supervisor (Current User) string supervisorFullName = DMT.Controls.TAApp.User.Current.FullNameTH; inst.Parameters.Add(RdlcReportParameter.Create("supervisorFullName", supervisorFullName)); return(inst); }
private RdlcReportModel GetReportModel() { Assembly assembly = this.GetType().Assembly; RdlcReportModel inst = new RdlcReportModel(); inst.Definition.EmbededReportName = "DMT.TA.Pages.Reports.CouponSalesReceiptRep.rdlc"; inst.Definition.RdlcInstance = RdlcReportUtils.GetEmbededReport(assembly, inst.Definition.EmbededReportName); // clear reprot datasource. inst.DataSources.Clear(); var tsb = ops.TSB.GetCurrent().Value(); // load C35 items. List <TSBCouponTransaction> c35Items = new List <TSBCouponTransaction>(); var c35coupons = (null != _manager) ? _manager.C35TSBSolds : null; if (null != c35coupons) { c35Items.AddRange(c35coupons); } // load C80 items. List <TSBCouponTransaction> c80Items = new List <TSBCouponTransaction>(); var c80coupons = (null != _manager) ? _manager.C80TSBSolds : null; if (null != c80coupons) { c80Items.AddRange(c80coupons); } // create and calculate main summary list. List <TSBCouponSummary> items = new List <TSBCouponSummary>(); _summary = new TSBCouponSummary(); _summary.UserId = _manager.User.UserId; _summary.FullNameEN = _manager.User.FullNameEN; _summary.FullNameTH = _manager.User.FullNameTH; _summary.TSBId = tsb.TSBId; _summary.TSBNameEN = tsb.TSBNameEN; _summary.TSBNameTH = tsb.TSBNameTH; _summary.CountCouponBHT35 = c35Items.Count; _summary.CountCouponBHT80 = c80Items.Count; decimal a35 = decimal.Zero; c35Items.ForEach(c35 => { a35 += c35.Price; }); decimal a80 = decimal.Zero; c80Items.ForEach(c80 => { a80 += c80.Price; }); _summary.AmountCouponBHT35 = a35; _summary.AmountCouponBHT80 = a80; if (null != _summary) { items.Add(_summary); } // assign new data source (main for header) RdlcReportDataSource mainDS = new RdlcReportDataSource(); mainDS.Name = "main"; // the datasource name in the rdlc report. mainDS.Items = items; // setup data source // Add to datasources inst.DataSources.Add(mainDS); // assign new data source (main for coupon35) RdlcReportDataSource c35DS = new RdlcReportDataSource(); c35DS.Name = "C35"; // the datasource name in the rdlc report. c35DS.Items = c35Items; // setup data source // Add to datasources inst.DataSources.Add(c35DS); // assign new data source (main for coupon80) RdlcReportDataSource c80DS = new RdlcReportDataSource(); c80DS.Name = "C80"; // the datasource name in the rdlc report. c80DS.Items = c80Items; // setup data source // Add to datasources inst.DataSources.Add(c80DS); // Add parameters (if required). // Coupon Received Date. DateTime today = DateTime.Today; //string couponDate = today.ToThaiDateTimeString("dd/MM/yyyy HH:mm:ss"); string couponDate = today.ToThaiDateTimeString("dd/MM/yyyy"); inst.Parameters.Add(RdlcReportParameter.Create("couponDate", couponDate)); // Supervisor (Current User) string supervisorFullName = DMT.Controls.TAApp.User.Current.FullNameTH; inst.Parameters.Add(RdlcReportParameter.Create("supervisorFullName", supervisorFullName)); _runningNumber = "630000x"; // TODO: Implements Running Number for Receipt. inst.Parameters.Add(RdlcReportParameter.Create("runningNumber", _runningNumber)); return(inst); }