public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            product_item rpt = new product_item();

            rpt.Site = this.Site;
            return(rpt);
        }
Exemple #2
0
        private void Form_item_category_Load(object sender, EventArgs e)
        {
            List <Products_DATA> product = new List <Products_DATA>();

            product = category.Products;
            product_item products      = new product_item();
            DataTable    table_product = new DataTable();

            table_product.Columns.Add("Id");
            table_product.Columns.Add("label_product");
            table_product.Columns.Add("qte_in_product");
            table_product.Columns.Add("price");
            table_product.Columns.Add("image", typeof(byte[]));
            table_product.Columns.Add("category_FK");
            table_product.Columns.Add("description");
            foreach (var item in product)
            {
                table_product.Rows.Add(item.Id, item.Label_product, item.Qte_in_product, item.Price, item.Image, item.Category.Id, item.Category.Description);
            }



            CrystalReport_item_category s = new CrystalReport_item_category();
            DataTable table = new DataTable();

            table.Columns.Add("Id");
            table.Columns.Add("description");
            table.Rows.Add(category.Id, category.Description);
            s.Subreports[0].SetDataSource(table_product);
            s.SetDataSource(table);

            //     s.Load(@"..\\Report_view\\product_item.rpt");

            crystalReportViewer1.ReportSource = s;
        }
        private void Form_item_product_Load(object sender, EventArgs e)
        {
            product_item s     = new product_item();
            DataTable    table = new DataTable();

            table.Columns.Add("Id");
            table.Columns.Add("label_product");
            table.Columns.Add("qte_in_product");
            table.Columns.Add("price");
            table.Columns.Add("image", typeof(byte[]));
            table.Columns.Add("category_FK");
            table.Columns.Add("description");
            table.Rows.Add(product.Id, product.Label_product, product.Qte_in_product, product.Price, product.Image, product.Category.Id, product.Category.Description);
            s.SetDataSource(table);
            crystalReportViewer1.ReportSource = s;
        }