Пример #1
0
        private void reporteUtilidades()
        {
            try
            {
                string reporteFile = "Presentacion.Reportes.ReportAnalisisUtilidades.rdlc";

                Base.FormViewReporte report = new Base.FormViewReporte();
                report.rptView.LocalReport.DataSources.Clear();
                report.rptView.LocalReport.Dispose();

                report.rptView.Reset();
                report.rptView.Clear();

                Datos.DataAnalisisUtilidadesTableAdapters.AnalisisGeneralTableAdapter ta
                    = new Datos.DataAnalisisUtilidadesTableAdapters.AnalisisGeneralTableAdapter();

                Datos.DataAnalisisUtilidades.AnalisisGeneralDataTable tabla = new Datos.DataAnalisisUtilidades.AnalisisGeneralDataTable();

                //MessageBox.Show(finicial + "--" + ffinal.Date);
                nconf = !chkVentaUtilidad.Checked ? 'S':'N';
                if (!chkProducto.Checked)
                {
                    ta.Fill(tabla, finicial, ffinal, nconf + "");
                }
                else
                {
                    ta.FillByProducto(tabla, finicial, ffinal, nconf + "", codigoProd);
                }



                report.rptView.LocalReport.DataSources.Add(new ReportDataSource("DataAnalisisUtilidad",
                                                                                (DataTable)tabla));
                report.rptView.LocalReport.ReportEmbeddedResource = reporteFile;

                report.Text = "Analisis de Utilidades";

                // report.rptView.Refresh();

                report.rptView.SetDisplayMode(DisplayMode.PrintLayout);
                report.rptView.ZoomMode = ZoomMode.Percent;
                //Seleccionamos el zoom que deseamos utilizar. En este caso un 100%
                report.rptView.ZoomPercent = 100;
                report.rptView.RefreshReport();

                report.ShowDialog();
            }
            catch (Exception ex)
            {
                Datos.Excepciones.Gestionar(ex);
                MessageBox.Show(ex.Message);
            }
        }
Пример #2
0
        private void reporteVentas()
        {
            string reporteFile = "Presentacion.Reportes.ReportAnalisisVentas.rdlc";

            Base.FormViewReporte report = new Base.FormViewReporte();
            report.rptView.LocalReport.DataSources.Clear();
            report.rptView.LocalReport.Dispose();

            report.rptView.Reset();
            report.rptView.Clear();

            Datos.DataAnalisisVentasTableAdapters.TVenta_AnalisisTableAdapter ta
                = new Datos.DataAnalisisVentasTableAdapters.TVenta_AnalisisTableAdapter();

            Datos.DataAnalisisVentas.TVenta_AnalisisDataTable tabla = new Datos.DataAnalisisVentas.TVenta_AnalisisDataTable();

            if (chkVenta.Checked)
            {
                ta.Fill(tabla, finicial + "", ffinal + "");
            }
            else
            {
                ta.FillBySNVentas(tabla, finicial + "", ffinal + "");
            }

            report.rptView.LocalReport.DataSources.Clear();

            report.rptView.LocalReport.DataSources.Add(new ReportDataSource("DataAnalisisVentas",
                                                                            (DataTable)tabla));
            report.rptView.LocalReport.ReportEmbeddedResource = reporteFile;

            report.Text = "Analisis de Ventas";

            // report.rptView.Refresh();

            report.rptView.SetDisplayMode(DisplayMode.PrintLayout);
            report.rptView.ZoomMode = ZoomMode.Percent;
            //Seleccionamos el zoom que deseamos utilizar. En este caso un 100%
            report.rptView.ZoomPercent = 100;
            report.rptView.RefreshReport();

            report.ShowDialog();
        }
Пример #3
0
        private void btnVer_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            Pedido_codigo  = (Int32)(dtLista.SelectedRows[0].Cells[0].Value);

            Base.FormViewReporte report = new Base.FormViewReporte();
            report.rptView.LocalReport.DataSources.Clear();
            report.rptView.LocalReport.Dispose();



            report.rptView.Reset();

            Datos.DataDetallePedidosTableAdapters.TPedido_ForeignTableAdapter ta
                = new Datos.DataDetallePedidosTableAdapters.TPedido_ForeignTableAdapter();

            Datos.DataDetallePedidosTableAdapters.TDetalle_Pedido_ForeignTableAdapter dta
                = new Datos.DataDetallePedidosTableAdapters.TDetalle_Pedido_ForeignTableAdapter();


            Datos.DataDetallePedidos.TPedido_ForeignDataTable tabla = new Datos.DataDetallePedidos.TPedido_ForeignDataTable();

            Datos.DataDetallePedidos.TDetalle_Pedido_ForeignDataTable dtabla = new Datos.DataDetallePedidos.TDetalle_Pedido_ForeignDataTable();


            ta.FillByCodigo(tabla, Pedido_codigo);
            dta.FillByPedidoCod1(dtabla, Pedido_codigo);
            report.rptView.LocalReport.DataSources.Clear();
            report.rptView.LocalReport.DataSources.Add(new ReportDataSource("DataDetallePedido_Foreign",
                                                                            (DataTable)dtabla));
            report.rptView.LocalReport.DataSources.Add(new ReportDataSource("DataPedido",
                                                                            (DataTable)tabla));
            report.rptView.LocalReport.ReportEmbeddedResource = reporteFile;



            report.Text = "Detalle Pedidos";

            report.rptView.Refresh();
            report.ShowDialog();

            //try
            //{
            //    FormPedido frm = new FormPedido();
            //    var t = this.addPedido.getDatos(int.Parse(this.dtLista.CurrentRow.Cells[0].Value.ToString()));

            //    frm.editar = true;

            //    frm.txtCodigo.Text = "0000" + t.Codigo.ToString();
            //    frm.txtCotizacionmbre.Text = t.Cotizacionmbre;
            //    frm.cmbCategoria.SelectedText = t.Categoria;
            //    frm.cmbColor.SelectedText = t.Color;
            //    frm.cmbDimension.SelectedText = t.Dimension;
            //    frm.cmbUnidad.SelectedText = t.Unidad;

            //    frm.txtStock.Text = "" + t.Stock;
            //    frm.txtStockMin.Text = "" + t.StockMin;
            //    frm.txtPedido.Text = "" + t.Pedido;
            //    frm.txtCompra.Text = "" + t.Compra;
            //    frm.txtDescripcion.Text = t.Descripcion;
            //    frm.chkIva.CheckState = t.IVA == 'S' ? CheckState.Checked : CheckState.Unchecked;
            //    frm.chkPrecioPedido.CheckState = CheckState.Unchecked;
            //    frm.txtProveedor.Text = t.Proveedor;


            //    frm.panelEx1.Enabled = false;

            //    frm.btnNuevo.Text = "Habilitar Edicion";
            //    frm.btnNuevo.Visible = true;
            //    frm.btnProveedor.Visible = false;
            //    frm.chkPrecioPedido.Visible = false;
            //    frm.label14.Visible = false;
            //    frm.ver = true;


            //       frm.ShowDialog();
            //    //this.Lista();
            //}
            //catch (Exception ex)
            //{

            //    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //}
        }
Пример #4
0
        private void btnVer_Click(object sender, EventArgs e)
        {
            if (dtLista.Rows.Count > 0)
            {
                Cursor.Current = Cursors.WaitCursor;
                Venta_codigo   = (Int32)(dtLista.SelectedRows[0].Cells[0].Value);

                Base.FormViewReporte report = new Base.FormViewReporte();
                report.rptView.LocalReport.DataSources.Clear();
                report.rptView.LocalReport.Dispose();



                report.rptView.Reset();
                report.rptView.ProcessingMode = ProcessingMode.Local;

                Datos.DataDetalleVentasTableAdapters.TVenta_ForeignTableAdapter ta
                    = new Datos.DataDetalleVentasTableAdapters.TVenta_ForeignTableAdapter();

                Datos.DataDetalleVentasTableAdapters.TDetalle_Venta_ForeignTableAdapter dta
                    = new Datos.DataDetalleVentasTableAdapters.TDetalle_Venta_ForeignTableAdapter();


                Datos.DataDetalleVentas.TVenta_ForeignDataTable tabla = new Datos.DataDetalleVentas.TVenta_ForeignDataTable();

                Datos.DataDetalleVentas.TDetalle_Venta_ForeignDataTable dtabla = new Datos.DataDetalleVentas.TDetalle_Venta_ForeignDataTable();


                ta.FillByCodigo(tabla, Venta_codigo);
                dta.FillByVentaCod1(dtabla, Venta_codigo);
                report.rptView.LocalReport.DataSources.Clear();
                report.rptView.LocalReport.DataSources.Add(new ReportDataSource("DataDetalleVenta_Foreign",
                                                                                (DataTable)dtabla));
                report.rptView.LocalReport.DataSources.Add(new ReportDataSource("DataVenta",
                                                                                (DataTable)tabla));
                report.rptView.LocalReport.ReportEmbeddedResource = reporteFile;



                report.Text = "Detalle Ventas";

                // report.rptView.Refresh();

                report.rptView.SetDisplayMode(DisplayMode.PrintLayout);
                report.rptView.ZoomMode = ZoomMode.Percent;
                //Seleccionamos el zoom que deseamos utilizar. En este caso un 100%
                report.rptView.ZoomPercent = 100;
                report.rptView.RefreshReport();

                report.ShowDialog();

                //try
                //{
                //    FormVenta frm = new FormVenta();
                //    var t = this.addVenta.getDatos(int.Parse(this.dtLista.CurrentRow.Cells[0].Value.ToString()));

                //    frm.editar = true;

                //    frm.txtCodigo.Text = "0000" + t.Codigo.ToString();
                //    frm.txtCotizacionmbre.Text = t.Cotizacionmbre;
                //    frm.cmbCategoria.SelectedText = t.Categoria;
                //    frm.cmbColor.SelectedText = t.Color;
                //    frm.cmbDimension.SelectedText = t.Dimension;
                //    frm.cmbUnidad.SelectedText = t.Unidad;

                //    frm.txtStock.Text = "" + t.Stock;
                //    frm.txtStockMin.Text = "" + t.StockMin;
                //    frm.txtVenta.Text = "" + t.Venta;
                //    frm.txtCompra.Text = "" + t.Compra;
                //    frm.txtDescripcion.Text = t.Descripcion;
                //    frm.chkIva.CheckState = t.IVA == 'S' ? CheckState.Checked : CheckState.Unchecked;
                //    frm.chkPrecioVenta.CheckState = CheckState.Unchecked;
                //    frm.txtProveedor.Text = t.Proveedor;


                //    frm.panelEx1.Enabled = false;

                //    frm.btnNuevo.Text = "Habilitar Edicion";
                //    frm.btnNuevo.Visible = true;
                //    frm.btnProveedor.Visible = false;
                //    frm.chkPrecioVenta.Visible = false;
                //    frm.label14.Visible = false;
                //    frm.ver = true;


                //       frm.ShowDialog();
                //    //this.Lista();
                //}
                //catch (Exception ex)
                //{

                //    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //}
            }
        }