Esempio n. 1
0
        public void Imprimir(String x_TipoReporte)
        {
            try
            {
                DSReporte = new DataSet();
                DataTable _Dt = new DataTable();
                LView.LoadFilters();
                MensajeError = String.Empty;
                if (FechaEmisionIni == null && FechaEmisionFin == null)
                {
                    MensajeError += "* Debe ingresar la fecha de desde y fecha de hasta" + Environment.NewLine;
                }
                if (FechaEmisionIni == null)
                {
                    MensajeError += "* Debe ingresar la fecha de desde" + Environment.NewLine;
                }
                if (FechaEmisionFin == null)
                {
                    MensajeError += "* Debe ingresar la fecha de hasta" + Environment.NewLine;
                }
                if (String.IsNullOrEmpty(MensajeError))
                {
                    if (!String.IsNullOrEmpty(x_TipoReporte))
                    {
                        _Dt = Client.GetAllOperacionLiquidacion(ENTC_CodigoFiltro, NroOperacion, HBLOperacion, FechaEmisionIni.Value, FechaEmisionFin.Value, x_TipoReporte);
                    }
                }
                else
                {
                    LView.ShowValidation();
                    return;
                }
                if (_Dt == null)
                {
                    Dialogos.MostrarMensajeInformacion(Titulo, "No se encontraron coincidencias."); return;
                }
                if (_Dt.Rows.Count == 0)
                {
                    Dialogos.MostrarMensajeInformacion(Titulo, "No se encontraron coincidencias."); return;
                }
                ReportPath = null;

                if (!String.IsNullOrEmpty(x_TipoReporte) && x_TipoReporte.Equals("Resumido"))
                {
                    ReportPath    = Application.StartupPath + @"\Reportes\RptIngresos.rdlc";
                    RepDataSource = new ReportDataSource("DsIngresos", _Dt);
                }
                else
                {
                    ReportPath    = Application.StartupPath + @"\Reportes\RptIngresosDetallado.rdlc";
                    RepDataSource = new ReportDataSource("DSIngresoDetallado", _Dt);
                }
                LView.ShowReporte();
            }
            catch (Exception ex)
            { throw ex; }
        }