예제 #1
0
        private void btnReporteInventario_Click(object sender, EventArgs e)
        {
            Diseño.reporte_sencillo_productos repo = new Diseño.reporte_sencillo_productos();
            repo.SetDataSource(datos);

            repo.Database.Tables["reporte_inventario_productos"].SetDataSource(datos.Tables[0]);
            repo.Subreports[0].Database.Tables["reporte_presentaciones"].SetDataSource(datos.Tables[2]);

            reporte.ReportSource = repo;
        }
예제 #2
0
        private void generar_reporte(bool tipo)
        {
            if (tipo)
            {
                Diseño.reporte_sencillo_productos repo = new Diseño.reporte_sencillo_productos();
                repo.SetDataSource(datos);
                repo.Database.Tables["reporte_inventario_productos"].SetDataSource(datos.Tables[3]);
                repo.Subreports[0].Database.Tables["reporte_presentaciones"].SetDataSource(datos.Tables[2]);

                reporte.ReportSource = repo;
            }
            else
            {
                Diseño.productos_inventario repo = new Diseño.productos_inventario();
                repo.SetDataSource(datos);
                repo.Database.Tables["reporte_inventario_productos"].SetDataSource(datos.Tables[3]);
                repo.Subreports[0].Database.Tables["codigos_producto"].SetDataSource(datos.Tables[1]);
                repo.Subreports[1].Database.Tables["reporte_presentaciones"].SetDataSource(datos.Tables[2]);
                reporte.ReportSource = repo;
            }
        }
예제 #3
0
        private void busqueda_categoria(string nombre, bool sencillo, string campo)
        {
            DataTable             prueba        = datos.Tables[0];
            IEnumerable <DataRow> productsQuery =
                from product in prueba.AsEnumerable()
                select product;

            IEnumerable <DataRow> largeProducts =
                productsQuery.Where(p => p.Field <string>(campo) == nombre);


            if (datos.Tables.Count == 3)
            {
                datos.Tables.Add(largeProducts.CopyToDataTable <DataRow>());
            }
            else
            {
                datos.Tables.RemoveAt(3);
                datos.Tables.Add(largeProducts.CopyToDataTable <DataRow>());
            }

            if (sencillo)
            {
                Diseño.reporte_sencillo_productos repo = new Diseño.reporte_sencillo_productos();
                repo.SetDataSource(datos);
                repo.Database.Tables["reporte_inventario_productos"].SetDataSource(datos.Tables[3]);
                repo.Subreports[0].Database.Tables["reporte_presentaciones"].SetDataSource(datos.Tables[2]);

                reporte.ReportSource = repo;
            }
            else
            {
                Diseño.productos_inventario repo = new Diseño.productos_inventario();
                repo.SetDataSource(datos);
                repo.Database.Tables["reporte_inventario_productos"].SetDataSource(datos.Tables[3]);
                repo.Subreports[0].Database.Tables["codigos_producto"].SetDataSource(datos.Tables[1]);
                repo.Subreports[1].Database.Tables["reporte_presentaciones"].SetDataSource(datos.Tables[2]);
                reporte.ReportSource = repo;
            }
        }