Esempio n. 1
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            var _productoBL   = new ProductosBL();
            var bindingSource = new BindingSource();
            var tipoProducto  = textBox1.Text;

            if (!string.IsNullOrEmpty(tipoProducto))
            {
                bindingSource.DataSource = _productoBL.ObtenerProductosP(tipoProducto);
            }
            else
            {
                bindingSource.DataSource = _productoBL.ObtenerProductos();
            }


            var reporte = new ReporteProducto();

            reporte.SetDataSource(bindingSource);
            crystalReportViewer1.ReportSource = reporte;
            crystalReportViewer1.RefreshReport();
            crystalReportViewer1.Show();
        }