Пример #1
0
        private void ImprimirReporteButton_Click(object sender, EventArgs e)
        {
            if (lista.Count == 0)
            {
                MessageBox.Show("No hay datos para imprimir");
                return;
            }

            ReporteCategorias categoriasReport = new ReporteCategorias(lista);

            categoriasReport.ShowDialog();
        }
Пример #2
0
        private void GenerarReporteCategoria()
        {
            DataTable lista = Cache.ConsultaCategorias("", 2);

            try
            {
                if (lista.Rows.Count > 0)
                {
                    ReporteCategorias reporte = new ReporteCategorias();
                    reporte.SetDataSource(lista);
                    reporte.SetParameterValue("pEmpleado", _Sesion.Informacion.Empleado);
                    reporte.SetParameterValue("pTotalProductos", "Total de categorias: " + lista.Rows.Count.ToString());
                    reporte.SetParameterValue("pFecha", DateTime.Now.ToString());
                    crvProductos.ReportSource = reporte;
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Excepcion reporte: " + e.ToString(), "Excepcion", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }