Пример #1
0
        public void VistaPreviaNotaCreditoCliente(Notacreditocli notacreditocliMnt)
        {
            Tipocp tipocp = Service.GetTipocp(x => x.Idtipocp == notacreditocliMnt.Idtipocp);

            const string nameRelation = "ventas.vwnotacreditocliimpresion";
            string       whereList    = string.Format("idnotacreditocli = {0}", notacreditocliMnt.Idnotacreditocli);
            const string ordersList   = "numeroitem";
            const string fieldsList   = "*";

            DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList);

            dt.TableName = "cp";

            if (string.IsNullOrEmpty(tipocp.Nombrereporte))
            {
                XtraMessageBox.Show("No se asignó un formato de impresión", "Atención", MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                return;
            }

            //ImporteLetras
            string importeDocumentoLetra = UtilityReport.ToNumberLetters(notacreditocliMnt.Totaldocumento.ToString(CultureInfo.InvariantCulture));
            string nameReporte           = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Ventas\\{0}", tipocp.Nombrereporte.Trim()));

            switch (tipocp.Tiporeporteador)
            {
            case 0:     //FastReport
                Report fastReport = new Report();

                fastReport.Load(nameReporte);
                fastReport.RegisterData(dt, "cp");
                fastReport.RegisterData(VwSucursalList, "emp");
                fastReport.SetParameterValue("ImporteDocLetras", importeDocumentoLetra);

                ReportHelper1 reportHelper1 = new ReportHelper1(fastReport);
                reportHelper1.ShowDialog();

                break;

            case 1:     //XtraReport

                //XtraReport xtraReport = new XtraReport { DataSource = dt };
                //xtraReport.LoadLayout(nameReporte);

                //Parametros
                object[] parametrosReporte =
                {
                    importeDocumentoLetra
                };

                ReportHelper2 reportHelper2 = new ReportHelper2(nameReporte, dt, parametrosReporte, "NotaCreditoCliente");
                reportHelper2.ShowDialog();
                break;
            }
        }
Пример #2
0
        private void Reporte()
        {
            DateTime fechaInicio  = (DateTime)iFechaInicio.EditValue;
            DateTime fechaFinal   = (DateTime)iFechaFinal.EditValue;
            int      idTipoMoneda = (int)iIdtipomoneda.EditValue;

            string    sqlQuery;
            string    nameFileReport = string.Empty;
            DataTable dt             = null;

            object[] parametros =
            {
                fechaInicio,
                fechaFinal,
                iIdcptooperacion.EditValue,
                iIdSocionegocio.EditValue,
                null,
                SessionApp.SucursalSel.Idsucursal,
                idTipoMoneda
            };

            switch (lbOptions.SelectedIndex)
            {
            case 0:    //Ordenes de compra pendiente de ingresos

                sqlQuery = "reportes.fn_cajaingresoegreso";

                dt = HelperDb.ExecuteStoreProcedure(sqlQuery, parametros);

                nameFileReport = "cajaingresoegresoresumen.repx";


                break;

            case 1:     //Ordenes de compra pendiente de comprobante de compra
                sqlQuery = "reportes.fn_cajaegreso";

                dt = HelperDb.ExecuteStoreProcedure(sqlQuery, parametros);

                nameFileReport = "cajaingresoegresoresumen.repx";
                break;

            case 2:     //Ordenes de compra pendiente de comprobante de compra
                sqlQuery = "reportes.fn_cajaingreso";

                dt = HelperDb.ExecuteStoreProcedure(sqlQuery, parametros);

                nameFileReport = "cajaingresoegresoresumen.repx";
                break;
            }

            //Parametros
            object[] parametrosReporte =
            {
                iIdtipomoneda.Text.Trim()
            };

            string     rutaArchivoReporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Gerencia\\{0}", nameFileReport));
            XtraReport xtraReport         = new XtraReport {
                DataSource = dt
            };

            xtraReport.LoadLayout(rutaArchivoReporte);
            ReportHelper2 reportHelper2 = new ReportHelper2(rutaArchivoReporte, dt, parametrosReporte, null);

            int opcionReporte = (int)rgOpcionReporte.EditValue;

            switch (opcionReporte)
            {
            case 0:     //Vistaprevia
                reportHelper2.ShowDialog();

                break;

            case 1:     //Diseño
                reportHelper2.ShowDialog();

                break;
            }
            reportHelper2.Dispose();
        }
Пример #3
0
        private void Reporte()
        {
            DateTime fechaInicio = (DateTime)iFechaInicio.EditValue;
            DateTime fechaFinal  = (DateTime)iFechaFinal.EditValue;

            string    sqlQuery;
            string    nameFileReport = string.Empty;
            DataTable dt             = null;

            object[] parametros =
            {
                fechaInicio,
                fechaFinal,
                iIdCentroCosto.EditValue,
                SessionApp.SucursalSel.Idsucursal
            };

            switch (lbOptions.SelectedIndex)
            {
            case 0:    //Ordenes de compra pendiente de ingresos

                sqlQuery = "reportes.fn_gastos_cc_resumen_articulo";

                dt = HelperDb.ExecuteStoreProcedure(sqlQuery, parametros);

                nameFileReport = "centrocostoxarticulo.repx";


                break;

            case 1:     //Ordenes de compra pendiente de comprobante de compra
                sqlQuery = "reportes.fn_gastos_cc_x_cp";

                dt = HelperDb.ExecuteStoreProcedure(sqlQuery, parametros);

                nameFileReport = "centrocostoxcomprobante.repx";
                break;
            }


            string     rutaArchivoReporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Gerencia\\{0}", nameFileReport));
            XtraReport xtraReport         = new XtraReport {
                DataSource = dt
            };

            xtraReport.LoadLayout(rutaArchivoReporte);
            ReportHelper2 reportHelper2 = new ReportHelper2(rutaArchivoReporte, dt, null, null);


            int opcionReporte = (int)rgOpcionReporte.EditValue;

            switch (opcionReporte)
            {
            case 0:     //Vistaprevia
                reportHelper2.ShowDialog();

                break;

            case 1:     //Diseño
                reportHelper2.ShowDialog();

                break;
            }
            reportHelper2.Dispose();
        }
Пример #4
0
        public void FormatoCpVenta(Cpventa cpventa)
        {
            Tipocp tipocp = Service.GetTipocp(x => x.Idtipocp == cpventa.Idtipocp);

            const string nameRelation = "ventas.vwcpventaimpresion";
            string       whereList    = string.Format("idcpventa = {0}", cpventa.Idcpventa);
            const string ordersList   = "numeroitem";
            const string fieldsList   = "*";

            DataTable dt = HelperDb.SqlConsulta(nameRelation, whereList, ordersList, fieldsList);

            dt.TableName = "cp";

            if (string.IsNullOrEmpty(tipocp.Nombrereporte))
            {
                XtraMessageBox.Show("No se asignó un formato de impresión", "Atención", MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                return;
            }

            VwCpventa vwCpventa = Service.GetVwCpventa(cpventa.Idcpventa);

            //ImporteLetras
            string importeDocumentoLetra = string.Format("{0} {1}", UtilityReport.ToNumberLetters(cpventa.Totaldocumento.ToString(CultureInfo.InvariantCulture)), vwCpventa.Nombretipomoneda);

            string nameReporte = FilesHelper.FindingFileName(Application.StartupPath, string.Format("Reportes\\Ventas\\{0}", tipocp.Nombrereporte.Trim()));

            switch (tipocp.Tiporeporteador)
            {
            case 0:     //FastReport
                Report fastReport = new Report();

                fastReport.Load(nameReporte);
                fastReport.RegisterData(dt, "cp");
                fastReport.RegisterData(VwSucursalList, "emp");
                fastReport.SetParameterValue("ImporteDocLetras", importeDocumentoLetra);

                ReportHelper1 reportHelper1 = new ReportHelper1(fastReport);
                reportHelper1.ShowDialog();

                break;

            case 1:     //XtraReport

                //XtraReport xtraReport = new XtraReport { DataSource = dt };
                //xtraReport.LoadLayout(nameReporte);
                //xtraReport.parameters["TotalDocumentoLetra"].Value = importeDocLetras;
                //xtraReport.RequestParameters = false;
                //xtraReport.ShowPreviewDialog();

                //Parametros
                object[] parametrosReporte =
                {
                    importeDocumentoLetra
                };

                ReportHelper2 reportHelper2 = new ReportHelper2(nameReporte, dt, parametrosReporte, "ComprobanteVenta");
                reportHelper2.ShowDialog();

                //XRDesignFormEx xRDesignFormEx = new XRDesignFormEx();
                //xRDesignFormEx.OpenReport(report);
                //xRDesignFormEx.DesignPanel.FileName = nameReporte;
                //xRDesignFormEx.ShowDialog();

                break;
            }
        }