Beispiel #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CrProduct rpt = new CrProduct();

            rpt.Site = this.Site;
            return(rpt);
        }
Beispiel #2
0
        private void LoadReportProduct()
        {
            IProductRepository productRepo = new ProductRepository();
            var listOfProduct = productRepo.GetAll();

            var listOfCategory = listOfProduct.Select(f => f.Category)
                                              .GroupBy(gb => gb.CategoryID).Select(g => g.First()).ToList();

            var listOfSupplier = listOfProduct.Select(f => f.Supplier)
                                              .GroupBy(gb => gb.SupplierID).Select(g => g.First()).ToList();

            var reportProduct = new CrProduct();

            // set data source report
            reportProduct.Database.Tables["Supplier"].SetDataSource(listOfSupplier);
            reportProduct.Database.Tables["Category"].SetDataSource(listOfCategory);
            reportProduct.Database.Tables["Product"].SetDataSource(listOfProduct);

            crystalReportViewer1.ReportSource = reportProduct;
        }
Beispiel #3
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     CrProduct rpt = new CrProduct();
     rpt.Site = this.Site;
     return rpt;
 }