private void PrintReceipt() { var facade = new Facade(); ArrayList source = new ArrayList(); var register = facade.Restaurant.Areas.SelectMany(a => a.Registers); var sale = (Controller as PaymentViewController).MainTask.Sale as ISale; var saleLineItems = sale.SaleLineItems; var categories = facade.Categories; var products = categories.SelectMany(p => p.Products); foreach (var sli in saleLineItems) { source.Add(new { RegisterName = register.First().Name, UserFirstName = sale.UserAccount.ToString(), SaleId = sale.Id, ProductDescription = products.Where(p => p.Id.Equals(sli.MenuProduct.ProductId)).FirstOrDefault().Description, Quantity = sli.Quantity, ProductPrice = sli.Total, GstTotal = sale.GSTTotal, SaleTotal = sale.SaleTotal, }); } var report = new SalesReport(); report.SetDataSource(source); crystalReportViewer1.ReportSource = report; ConnectReporter(); crystalReportViewer1.RefreshReport(); report.PrintToPrinter(1, false, 1, 1); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { SalesReport rpt = new SalesReport(); rpt.Site = this.Site; return(rpt); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { SalesReport rpt = new SalesReport(); rpt.Site = this.Site; return rpt; }