Exemplo n.º 1
0
        public void cargarReporte()
        {
            MySqlDataAdapter adapter;

            try
            {
                crearConsulta();
                ds      = new dataSet_inventarios();
                adapter = new MySqlDataAdapter(query, con);
                adapter.Fill(ds.Gastos_Prom_Ins);

                switch (cb_tipo.SelectedIndex)
                {
                case 0:    //Texto
                    reporteT = new crGastosPromT();
                    reporteT.SetDataSource(ds);
                    crv.ReportSource = reporteT;
                    break;

                case 1:    //Grafica
                    reporteG = new crGastosPromG();
                    reporteG.SetDataSource(ds);
                    crv.ReportSource = reporteG;
                    crv.Zoom(75);
                    break;

                case 2:    //Ambos
                    reporteA = new crGastosPromA();
                    reporteA.SetDataSource(ds);
                    crv.ReportSource = reporteA;
                    break;
                }
            }
            catch (FormatException fex)
            {
                MessageBox.Show(fex.Message);
            }
        }
Exemplo n.º 2
0
        public void cargarReporte()
        {
            MySqlDataAdapter adapter;

            try
            {
                crearConsulta();
                ds = new dataSet_inventarios();
                adapter = new MySqlDataAdapter(query, con);
                adapter.Fill(ds.Gastos_Prom_Ins);

                switch (cb_tipo.SelectedIndex)
                {
                    case 0://Texto
                        reporteT = new crGastosPromT();
                        reporteT.SetDataSource(ds);
                        crv.ReportSource = reporteT;
                    break;
                    case 1://Grafica
                        reporteG = new crGastosPromG();
                        reporteG.SetDataSource(ds);
                        crv.ReportSource = reporteG;
                        crv.Zoom(75);
                    break;
                    case 2://Ambos
                        reporteA = new crGastosPromA();
                        reporteA.SetDataSource(ds);
                        crv.ReportSource = reporteA;
                    break;
                }
            }
            catch (FormatException fex)
            {
                MessageBox.Show(fex.Message);
            }
        }