void traerdatos()
        {
            IMPRESION_REPORTES ven = new IMPRESION_REPORTES();

            ven.Text = "REPORTE DE SOBRANTES DE INVENTARIOS DE LA SUCURSAL";
            ven.reportViewer1.LocalReport.ReportEmbeddedResource = @"ALFARO_CAJA.REPORTES.REPORTE_DE_SOBRANTES.rdlc";
            ReportParameter[] parametros = new ReportParameter[1];
            parametros[0] = new ReportParameter("USU", STCODIGO.Text);
            ven.reportViewer1.LocalReport.SetParameters(parametros);
            ven.reportViewer1.RefreshReport();
            ReportDataSource rds = new ReportDataSource("RP_SOBRAS", REP.REPORTE_SOBRANTES_INVENTARIOS());

            ven.reportViewer1.LocalReport.DataSources.Clear();
            ven.reportViewer1.LocalReport.DataSources.Add(rds);
            ven.reportViewer1.RefreshReport();
            timer1.Stop();
            progressBar1.Visible = false;
            progressBar1.Value   = 0;
            ven.ShowDialog();
        }
예제 #2
0
 void muestra_solo()
 {
     progressBar1.Visible = true;
     if (PERFIL == "DEVOLUCIONES")
     {
         IMPRESION_REPORTES VEN = new IMPRESION_REPORTES();
         VEN.Text = "IMPRESION DE GUIA";
         VEN.reportViewer1.LocalReport.ReportEmbeddedResource = @"ALFARO_CAJA.REPORTES.G_Devolucion_Dev.rdlc";
         ReportParameter[] parametros = new ReportParameter[1];
         VEN.reportViewer1.RefreshReport();
         ReportDataSource rds  = new ReportDataSource("DEVO", REP.IMPR_GUIA_DEVOL_AREA_DEVOL(Convert.ToInt32(dataGridView1.CurrentRow.Cells["CODIGO"].Value)));
         ReportDataSource rds1 = new ReportDataSource("DEVO_DET", REP.IMPR_GUIA_DEVOL_DETALLES_AREA_DEVOLUCION(Convert.ToInt32(dataGridView1.CurrentRow.Cells["CODIGO"].Value)));
         VEN.reportViewer1.LocalReport.DataSources.Clear();
         VEN.reportViewer1.LocalReport.DataSources.Add(rds);
         VEN.reportViewer1.LocalReport.DataSources.Add(rds1);
         VEN.reportViewer1.RefreshReport();
         VEN.MdiParent = this.ParentForm;
         VEN.Show();
     }
     else
     {
         IMPRESION_REPORTES VEN = new IMPRESION_REPORTES();
         VEN.Text = "IMPRESION DE GUIA";
         VEN.reportViewer1.LocalReport.ReportEmbeddedResource = @"ALFARO_CAJA.REPORTES.G_Devolucion.rdlc";
         ReportParameter[] parametros = new ReportParameter[1];
         parametros[0] = new ReportParameter("USU", STCODIGO.Text);
         VEN.reportViewer1.LocalReport.SetParameters(parametros);
         VEN.reportViewer1.RefreshReport();
         ReportDataSource rds  = new ReportDataSource("DATOS_DEVO", REP.IMPR_GUIA_D(Convert.ToInt32(dataGridView1.CurrentRow.Cells["CODIGO"].Value)));
         ReportDataSource rds1 = new ReportDataSource("Detalles_devo", REP.IMPR_GUIA_DEVOL_DETALLES(Convert.ToInt32(dataGridView1.CurrentRow.Cells["CODIGO"].Value)));
         VEN.reportViewer1.LocalReport.DataSources.Clear();
         VEN.reportViewer1.LocalReport.DataSources.Add(rds);
         VEN.reportViewer1.LocalReport.DataSources.Add(rds1);
         VEN.reportViewer1.RefreshReport();
         VEN.MdiParent = this.ParentForm;
         VEN.Show();
     }
     progressBar1.Visible = false;
     progressBar1.Value   = 0;
 }
예제 #3
0
 void MUESTRA_SOLIDOS_CAPSULAS()
 {
     timer1.Start();
     progressBar1.Visible = true;
     for (int i = 0; i < dataGridView1.RowCount; i++)
     {
         IMPRESION_REPORTES VEN        = new IMPRESION_REPORTES();
         ReportParameter[]  parametros = new ReportParameter[2];
         VEN.Text = "IMPRESION DE FORMATOS DE INSPECCION";
         VEN.reportViewer1.LocalReport.ReportEmbeddedResource = @"ALFARO_CAJA.REPORTES.INSP_SOLIDOS_CAPSULAS.rdlc";
         parametros[0] = new ReportParameter("CODIGO", dataGridView1.Rows[i].Cells["COD"].Value.ToString());
         parametros[1] = new ReportParameter("FECHA", dataGridView1.Rows[i].Cells["FECHA"].Value.ToString());
         VEN.reportViewer1.LocalReport.SetParameters(parametros);
         VEN.reportViewer1.RefreshReport();
         ReportDataSource rds2 = new ReportDataSource("RPT_SOLIDOS", insp.VER_REPORTE_X_INSPECCION(Convert.ToInt32(dataGridView1.Rows[i].Cells["COD"].Value)));
         VEN.reportViewer1.LocalReport.DataSources.Add(rds2);
         VEN.reportViewer1.RefreshReport();
         VEN.MdiParent = this.ParentForm;
         VEN.Show();
     }
     progressBar1.Visible = false;
     progressBar1.Value   = 0;
 }
예제 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (comboBox1.Text == "ERROR IMPRESION")
            {
                LBLNUMEROCORR.Text = dv.Devolver_numero("CHRC2", "ALFCHI021");
                DialogResult result = MessageBox.Show(this, "¿DESEA GENERAR NUEVAMENTE LA GUIA?" + Environment.NewLine + "NUEVO CORRELATIVO:" + LBLNUMEROCORR.Text, VariablesGlobales.Titulo, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    int MSJE = dv.REGISTRO_DEV(LBLREFFT.Text, LBLREFGUIA.Text, Convert.ToInt32(CMBTRANSPORTISTA.SelectedValue), Convert.ToInt32(CMBLINEA.SelectedValue), STCODIGO.Text, LBLNUMEROCORR.Text, "----", Convert.ToDateTime(lblfchaigm.Text));
                    if (MSJE == 0)
                    {
                        MessageBox.Show(this, "HUBO UN ERROR NO SE PUEDE REGISTRAR COMUNIQUESE CON EL AREA DE SISTEMAS", VariablesGlobales.Titulo, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        MessageBox.Show(this, dv.ANULAR_GUIA(Convert.ToInt32(LBLCODIGODEV.Text), comboBox1.Text), VariablesGlobales.Titulo, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        for (int i = 0; i < dataGridView1.RowCount; i++)
                        {
                            REGISTRO_DETALLE(dataGridView1.Rows[i].Cells["UNDM"].Value.ToString(),
                                             dataGridView1.Rows[i].Cells["DESCRIPCION"].Value.ToString(),
                                             dataGridView1.Rows[i].Cells["CANT.DEV"].Value.ToString(),
                                             dataGridView1.Rows[i].Cells["LOTE"].Value.ToString(),
                                             dataGridView1.Rows[i].Cells["CANT_FAC"].Value.ToString(),
                                             dataGridView1.Rows[i].Cells["MOTIVO_FC"].Value.ToString(),
                                             dataGridView1.Rows[i].Cells["MOTIVO_M"].Value.ToString(),
                                             MSJE, dataGridView1.Rows[i].Cells["OBSV"].Value.ToString());
                        }

                        MessageBox.Show(this, "SE GENERO LA NUEVA GUIA", VariablesGlobales.Titulo, MessageBoxButtons.OK, MessageBoxIcon.Information);

                        IMPRESION_REPORTES VEN = new IMPRESION_REPORTES();
                        VEN.Text = "RE-IMPRESION GUIA DEVOLUCION";
                        VEN.reportViewer1.LocalReport.ReportEmbeddedResource = @"ALFARO_CAJA.REPORTES.G_Devolucion.rdlc";
                        ReportParameter[] parametros = new ReportParameter[1];
                        parametros[0] = new ReportParameter("USU", STCODIGO.Text);
                        VEN.reportViewer1.LocalReport.SetParameters(parametros);
                        VEN.reportViewer1.RefreshReport();
                        ReportDataSource rds  = new ReportDataSource("DATOS_DEVO", rp.IMPR_GUIA_D(MSJE));
                        ReportDataSource rds1 = new ReportDataSource("Detalles_devo", rp.IMPR_GUIA_DEVOL_DETALLES(MSJE));
                        VEN.reportViewer1.LocalReport.DataSources.Clear();
                        VEN.reportViewer1.LocalReport.DataSources.Add(rds);
                        VEN.reportViewer1.LocalReport.DataSources.Add(rds1);
                        VEN.reportViewer1.RefreshReport();
                        VEN.Show();
                        this.Hide();
                    }
                }
                else
                {
                    DialogResult resultado = MessageBox.Show("DESEA ANULAR LA GUIA N°:" + LBLGUIA.Text, "ANULAR GUIA", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (resultado == DialogResult.Yes)
                    {
                        MessageBox.Show(this, dv.ANULAR_GUIA(Convert.ToInt32(LBLCODIGODEV.Text), comboBox1.Text), VariablesGlobales.Titulo, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        LBLESTADO.Text        = "";
                        LBLCODIGODEV.Text     = "0";
                        LBLGUIA.Text          = "";
                        LBLFECHA.Text         = "";
                        LBLFECHATRASLADO.Text = "";
                        CMBLINEA.Text         = "";
                        CMBTRANSPORTISTA.Text = "";
                    }
                }
            }
        }
예제 #5
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            IMPRESION_REPORTES VEN = new IMPRESION_REPORTES();

            ReportParameter[] parametros = new ReportParameter[2];
            if (comboBox1.Text.Equals("LIQUIDOS - JARABE"))
            {
                timer1.Start();
                VISRO          frm = new VISRO(); //formulario con CrystalReportViewer
                ReportDocument rpt = new ReportDocument();
                //rpt.Load(@"C:\Users\costos\Desktop\SISTEMA DE GESTION ALFARO\ALFARO CAJA\REPORTES\LIQJARA.rpt");
                rpt.Load("C:/SI_Gestion/REPORTES/LIQJARA.rpt");
                DataSet   ds   = new DataSet();
                DataTable dt_c = new DataTable(); //ResultSet de DB
                dt_c = insp.VER_REPORTE_X_INSPECCION(Convert.ToInt32(dataGridView1.CurrentRow.Cells["COD"].Value));
                ds.Tables.Add(dt_c);
                rpt.Database.Tables[0].SetDataSource(ds.Tables[0]);
                rpt.SetParameterValue("CODIGO", dataGridView1.CurrentRow.Cells["COD"].Value.ToString());
                rpt.SetParameterValue("FECHA", dataGridView1.CurrentRow.Cells["FECHA"].Value.ToString());
                ((CrystalDecisions.Windows.Forms.CrystalReportViewer)frm.Controls["crystalReportViewer1"]).ReportSource    = rpt;
                ((CrystalDecisions.Windows.Forms.CrystalReportViewer)frm.Controls["crystalReportViewer1"]).EnableDrillDown = false;

                frm.Refresh();  //se refresca
                timer1.Stop();
                progressBar1.Visible = false;
                progressBar1.Value   = 0;
                //rpt.PrintOptions.PrinterName = "PRIMER_PISO";
                //rpt.PrintToPrinter(1, false, 0, 0);  //se imprime
                frm.Text = "IMPRESION DE FORMATOS DE INSPECCION";
                frm.Show();
            }
            else if (comboBox1.Text.Equals("LIQUIDOS - AMPOLLA"))
            {
                timer1.Start();
                VISRO          frm = new VISRO(); //formulario con CrystalReportViewer
                ReportDocument rpt = new ReportDocument();
                //rpt.Load(@"C:\Users\costos\Desktop\SISTEMA DE GESTION ALFARO\ALFARO CAJA\REPORTES\LIQAMPOLLAS.rpt");
                rpt.Load("C:/SI_Gestion/REPORTES/LIQAMPOLLAS.rpt");
                DataSet   ds   = new DataSet();
                DataTable dt_c = new DataTable();     //ResultSet de DB
                dt_c = insp.VER_REPORTE_X_INSPECCION(Convert.ToInt32(dataGridView1.CurrentRow.Cells["COD"].Value));
                ds.Tables.Add(dt_c);
                rpt.Database.Tables[0].SetDataSource(ds.Tables[0]);
                rpt.SetParameterValue("CODIGO", dataGridView1.CurrentRow.Cells["COD"].Value.ToString());
                rpt.SetParameterValue("FECHA", dataGridView1.CurrentRow.Cells["FECHA"].Value.ToString());
                ((CrystalDecisions.Windows.Forms.CrystalReportViewer)frm.Controls["crystalReportViewer1"]).ReportSource    = rpt;
                ((CrystalDecisions.Windows.Forms.CrystalReportViewer)frm.Controls["crystalReportViewer1"]).EnableDrillDown = false;

                frm.Refresh();      //se refresca
                timer1.Stop();
                progressBar1.Visible = false;
                progressBar1.Value   = 0;
                //rpt.PrintOptions.PrinterName = "PRIMER_PISO";
                //rpt.PrintToPrinter(1, false, 0, 0);  //se imprime
                frm.Text = "IMPRESION DE FORMATOS DE INSPECCION";
                frm.Show();
            }

            else if (comboBox1.Text.Equals("LIQUIDOS - PRODUCTOS SANITARIOS"))
            {
                timer1.Start();
                VISRO          frm = new VISRO(); //formulario con CrystalReportViewer
                ReportDocument rpt = new ReportDocument();
                //rpt.Load(@"C:\Users\costos\Desktop\SISTEMA DE GESTION ALFARO\ALFARO CAJA\REPORTES\LIQPROSANIT.rpt");
                rpt.Load("C:/SI_Gestion/REPORTES/LIQPROSANIT.rpt");
                DataSet   ds   = new DataSet();
                DataTable dt_c = new DataTable(); //ResultSet de DB
                dt_c = insp.VER_REPORTE_X_INSPECCION(Convert.ToInt32(dataGridView1.CurrentRow.Cells["COD"].Value));
                ds.Tables.Add(dt_c);
                rpt.Database.Tables[0].SetDataSource(ds.Tables[0]);
                rpt.SetParameterValue("CODIGO", dataGridView1.CurrentRow.Cells["COD"].Value.ToString());
                rpt.SetParameterValue("FECHA", dataGridView1.CurrentRow.Cells["FECHA"].Value.ToString());
                ((CrystalDecisions.Windows.Forms.CrystalReportViewer)frm.Controls["crystalReportViewer1"]).ReportSource    = rpt;
                ((CrystalDecisions.Windows.Forms.CrystalReportViewer)frm.Controls["crystalReportViewer1"]).EnableDrillDown = false;

                frm.Refresh();  //se refresca
                timer1.Stop();
                progressBar1.Visible = false;
                progressBar1.Value   = 0;
                //rpt.PrintOptions.PrinterName = "PRIMER_PISO";
                //rpt.PrintToPrinter(1, false, 0, 0);  //se imprime
                frm.Text = "IMPRESION DE FORMATOS DE INSPECCION";
                frm.Show();
            }
            else if (comboBox1.Text.Equals("SOLIDOS - TABLETAS"))
            {
                timer1.Start();
                VISRO          frm = new VISRO(); //formulario con CrystalReportViewer
                ReportDocument rpt = new ReportDocument();
                //rpt.Load(@"C:\Users\costos\Desktop\SISTEMA DE GESTION ALFARO\ALFARO CAJA\REPORTES\SOLTAB.rpt");
                rpt.Load("C:/SI_Gestion/REPORTES/SOLTAB.rpt");
                DataSet   ds   = new DataSet();
                DataTable dt_c = new DataTable(); //ResultSet de DB
                dt_c = insp.VER_REPORTE_X_INSPECCION(Convert.ToInt32(dataGridView1.CurrentRow.Cells["COD"].Value));
                ds.Tables.Add(dt_c);
                rpt.Database.Tables[0].SetDataSource(ds.Tables[0]);
                rpt.SetParameterValue("CODIGO", dataGridView1.CurrentRow.Cells["COD"].Value.ToString());
                rpt.SetParameterValue("FECHA", dataGridView1.CurrentRow.Cells["FECHA"].Value.ToString());
                ((CrystalDecisions.Windows.Forms.CrystalReportViewer)frm.Controls["crystalReportViewer1"]).ReportSource    = rpt;
                ((CrystalDecisions.Windows.Forms.CrystalReportViewer)frm.Controls["crystalReportViewer1"]).EnableDrillDown = false;

                frm.Refresh();  //se refresca
                timer1.Stop();
                progressBar1.Visible = false;
                progressBar1.Value   = 0;
                //rpt.PrintOptions.PrinterName = "PRIMER_PISO";
                //rpt.PrintToPrinter(1, false, 0, 0);  //se imprime
                frm.Text = "IMPRESION DE FORMATOS DE INSPECCION";
                frm.Show();
            }
            else if (comboBox1.Text.Equals("SOLIDOS - OVULOS Y CREMAS"))
            {
                timer1.Start();
                VISRO          frm = new VISRO(); //formulario con CrystalReportViewer
                ReportDocument rpt = new ReportDocument();
                //rpt.Load(@"C:\Users\costos\Desktop\SISTEMA DE GESTION ALFARO\ALFARO CAJA\REPORTES\SOLOVCREMA.rpt");
                rpt.Load("C:/SI_Gestion/REPORTES/SOLOVCREMA.rpt");
                DataSet   ds   = new DataSet();
                DataTable dt_c = new DataTable(); //ResultSet de DB
                dt_c = insp.VER_REPORTE_X_INSPECCION(Convert.ToInt32(dataGridView1.CurrentRow.Cells["COD"].Value));
                ds.Tables.Add(dt_c);
                rpt.Database.Tables[0].SetDataSource(ds.Tables[0]);
                rpt.SetParameterValue("CODIGO", dataGridView1.CurrentRow.Cells["COD"].Value.ToString());
                rpt.SetParameterValue("FECHA", dataGridView1.CurrentRow.Cells["FECHA"].Value.ToString());
                ((CrystalDecisions.Windows.Forms.CrystalReportViewer)frm.Controls["crystalReportViewer1"]).ReportSource    = rpt;
                ((CrystalDecisions.Windows.Forms.CrystalReportViewer)frm.Controls["crystalReportViewer1"]).EnableDrillDown = false;

                frm.Refresh();  //se refresca
                timer1.Stop();
                progressBar1.Visible = false;
                progressBar1.Value   = 0;
                //rpt.PrintOptions.PrinterName = "PRIMER_PISO";
                //rpt.PrintToPrinter(1, false, 0, 0);  //se imprime
                frm.Text = "IMPRESION DE FORMATOS DE INSPECCION";
                frm.Show();
            }

            else if (comboBox1.Text.Equals("SOLIDOS - VIALES"))
            {
                timer1.Start();
                VISRO          frm = new VISRO(); //formulario con CrystalReportViewer
                ReportDocument rpt = new ReportDocument();
                //rpt.Load(@"C:\Users\costos\Desktop\SISTEMA DE GESTION ALFARO\ALFARO CAJA\REPORTES\SOLTVIALES.rpt");
                rpt.Load("C:/SI_Gestion/REPORTES/SOLTVIALES.rpt");
                DataSet   ds   = new DataSet();
                DataTable dt_c = new DataTable(); //ResultSet de DB
                dt_c = insp.VER_REPORTE_X_INSPECCION(Convert.ToInt32(dataGridView1.CurrentRow.Cells["COD"].Value));
                ds.Tables.Add(dt_c);
                rpt.Database.Tables[0].SetDataSource(ds.Tables[0]);
                rpt.SetParameterValue("CODIGO", dataGridView1.CurrentRow.Cells["COD"].Value.ToString());
                rpt.SetParameterValue("FECHA", dataGridView1.CurrentRow.Cells["FECHA"].Value.ToString());
                ((CrystalDecisions.Windows.Forms.CrystalReportViewer)frm.Controls["crystalReportViewer1"]).ReportSource    = rpt;
                ((CrystalDecisions.Windows.Forms.CrystalReportViewer)frm.Controls["crystalReportViewer1"]).EnableDrillDown = false;

                frm.Refresh();  //se refresca
                timer1.Stop();
                progressBar1.Visible = false;
                progressBar1.Value   = 0;
                //rpt.PrintOptions.PrinterName = "PRIMER_PISO";
                //rpt.PrintToPrinter(1, false, 0, 0);  //se imprime
                frm.Text = "IMPRESION DE FORMATOS DE INSPECCION";
                frm.Show();
            }
            else
            {
                timer1.Start();
                VISRO          frm = new VISRO(); //formulario con CrystalReportViewer
                ReportDocument rpt = new ReportDocument();
                //rpt.Load(@"C:\Users\costos\Desktop\SISTEMA DE GESTION ALFARO\ALFARO CAJA\REPORTES\SOLCAP.rpt");
                rpt.Load("C:/SI_Gestion/REPORTES/SOLCAP.rpt");
                DataSet   ds   = new DataSet();
                DataTable dt_c = new DataTable(); //ResultSet de DB
                dt_c = insp.VER_REPORTE_X_INSPECCION(Convert.ToInt32(dataGridView1.CurrentRow.Cells["COD"].Value));
                ds.Tables.Add(dt_c);
                rpt.Database.Tables[0].SetDataSource(ds.Tables[0]);
                rpt.SetParameterValue("CODIGO", dataGridView1.CurrentRow.Cells["COD"].Value.ToString());
                rpt.SetParameterValue("FECHA", dataGridView1.CurrentRow.Cells["FECHA"].Value.ToString());
                ((CrystalDecisions.Windows.Forms.CrystalReportViewer)frm.Controls["crystalReportViewer1"]).ReportSource    = rpt;
                ((CrystalDecisions.Windows.Forms.CrystalReportViewer)frm.Controls["crystalReportViewer1"]).EnableDrillDown = false;

                frm.Refresh();  //se refresca
                timer1.Stop();
                progressBar1.Visible = false;
                progressBar1.Value   = 0;
                //rpt.PrintOptions.PrinterName = "PRIMER_PISO";
                //rpt.PrintToPrinter(1, false, 0, 0);  //se imprime
                frm.Text = "IMPRESION DE FORMATOS DE INSPECCION";
                frm.Show();
            }
        }