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(); }
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); } }