Ejemplo n.º 1
0
        public Form1()
        {
            var facade = new Facade();

            var register = from reg in facade.Restaurant.Areas.SelectMany(a => a.Registers)
                           select new { Name = reg.Name };

            var people = from ppl in facade.People select new { FirstName = ppl.FirstName, LastName = ppl.LastName };

            var payment = from pay in facade.Restaurant.Areas.SelectMany(a => a.Registers.SelectMany(r => r.Sales.SelectMany(p => p.Payments)))
                          select new { SaleId = pay.SaleId, Amount = pay.Amount };

            var report = new CrystalReport1();
            ArrayList records = new ArrayList();
            records.Add(register);
            records.Add(people);
            records.Add(payment);
            report.SetDataSource(records);

            crystalReportViewer1.ReportSource = report;
            crystalReportViewer1.RefreshReport();
        }
Ejemplo n.º 2
0
        public Form1()
        {
            var facade = new Facade();

            var register = from reg in facade.Restaurant.Areas.SelectMany(a => a.Registers)
                           select new { Name = reg.Name };

            var people = from ppl in facade.People select new { FirstName = ppl.FirstName, LastName = ppl.LastName };

            var payment = from pay in facade.Restaurant.Areas.SelectMany(a => a.Registers.SelectMany(r => r.Sales.SelectMany(p => p.Payments)))
                          select new { SaleId = pay.SaleId, Amount = pay.Amount };

            var       report  = new CrystalReport1();
            ArrayList records = new ArrayList();

            records.Add(register);
            records.Add(people);
            records.Add(payment);
            report.SetDataSource(records);

            crystalReportViewer1.ReportSource = report;
            crystalReportViewer1.RefreshReport();
        }
Ejemplo n.º 3
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     CrystalReport1 rpt = new CrystalReport1();
     rpt.Site = this.Site;
     return rpt;
 }