public void Imprimir() { try { DSReporte = new DataSet(); 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(TipoReporte)) { DSReporte = Client.GetAllServiciosAdicionalesReporte(ENTC_CodigoFiltro, FechaEmisionIni.Value, FechaEmisionFin.Value, TipoReporte); } } else { LView.ShowValidation(); return; } if (DSReporte == null) { return; } if (DSReporte.Tables.Count < 1 && DSReporte.Tables[0].Rows.Count == 0) { Dialogos.MostrarMensajeInformacion(Titulo, "No se encontraron coincidencias."); return; } ReportPath = TipoReporte.Equals("Transporte") ? Application.StartupPath + @"\Reportes\RptServiciosAdicionales.rdlc" : Application.StartupPath + @"\Reportes\RptServiciosAdicionalesAduana.rdlc"; RepDataSource = new ReportDataSource(TipoReporte.Equals("Transporte") ? "DsServiciosAdicionales" : "DsServiciosAdicionalesAduana", DSReporte.Tables[0]); Parameters = new ReportParameter[1]; Parameters[0] = new ReportParameter("TipoReporte", TipoReporte); MView.ShowReporte(); ((PRO008RMView)MView).ShowDialog(); } catch (Exception ex) { throw ex; } }
public void ImprimirFactura() { try { DSReporte = new DataSet(); String fecha = String.Empty; fecha = Session.Fecha.Year.ToString() + Session.Fecha.Month.ToString().PadLeft(2, '0').Trim() + Session.Fecha.Day.ToString().PadLeft(2, '0').Trim(); var First = Client.GetOneTiposCambio(fecha); TipoCambio = 0; TipoCambio = First != null ? First.TIPC_Compra:0; if (TipoCambio > 0) { DSReporte = Client.GetPreLiquidacion(COPE_Codigo, TipoReporte); if (DSReporte != null) { if (DSReporte.Tables.Count < 1) { Dialogos.MostrarMensajeInformacion(Titulo, "No se encontraron coincidencias."); return; } if (!String.IsNullOrEmpty(TipoReporte) && TipoReporte.Equals("ConServicioLogistico")) { ReportPath = Application.StartupPath + @"\Reportes\RptPreLiquidacion.rdlc"; RepDataSourceCabecera = new ReportDataSource("DSPreLiquidacion", DSReporte.Tables[0]); RepDataSourceDetalle = new ReportDataSource("DESLI", DSReporte.Tables[1]); RepDataSourceDetalleTransporte = new ReportDataSource("DsTransporte", DSReporte.Tables[2]); RepDataSourceDetalleAduana = new ReportDataSource("DsAduanero", DSReporte.Tables[3]); RepDataSourceDetalleOtrosServicios = new ReportDataSource("DsServiciosAdicionales", DSReporte.Tables[4]); } else if (!String.IsNullOrEmpty(TipoReporte) && TipoReporte.Equals("SinServicioLogistico")) { ReportPath = Application.StartupPath + @"\Reportes\RptPreLiquidacionSinSL.rdlc"; RepDataSourceCabecera = new ReportDataSource("DSPreLiquidacion", DSReporte.Tables[0]); RepDataSourceDetalleTransporte = new ReportDataSource("DsTransporte", DSReporte.Tables[2]); RepDataSourceDetalleAduana = new ReportDataSource("DsAduanero", DSReporte.Tables[3]); RepDataSourceDetalleOtrosServicios = new ReportDataSource("DsServiciosAdicionales", DSReporte.Tables[4]); } else // Liquidacion { ReportPath = Application.StartupPath + @"\Reportes\RptLiquidacion.rdlc"; RepDataSourceCabecera = new ReportDataSource("DsEncabezado", DSReporte.Tables[0]); RepDataSourceDetalleOtrosServicios = new ReportDataSource("DsAdicional", DSReporte.Tables[1]); RepDataSourceDetalle = new ReportDataSource("DsSLI", DSReporte.Tables[2]); RepDataSourceDetalleTransporte = new ReportDataSource("DsTransporte", DSReporte.Tables[3]); RepDataSourceDetalleAduana = new ReportDataSource("DsAduanero", DSReporte.Tables[4]); RepDataSourceServicioFox = new ReportDataSource("DsServiciosFox", DSReporte.Tables[5]); } Parameters = new ReportParameter[1]; Parameters[0] = new ReportParameter("TipoCambio", TipoCambio.ToString()); MView.ShowReporte(); ((PRO005RView)MView).ShowDialog(); } } else { Dialogos.MostrarMensajeInformacion(Titulo, "No se encontro el tipo de cambio de hoy verifique con el administrador de sistemas"); } } catch (Exception ex) { throw ex; } }
public void Imprimir() { try { DSReporte = new DataSet(); 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)) { DSReporte = Client.GetAllTarjasRebatesReporte(ENTC_CodigoFiltro, NroOperacion, HBLOperacion, FechaEmisionIni.Value, FechaEmisionFin.Value); } else { LView.ShowValidation(); return; } if (DSReporte == null) { return; } if (DSReporte.Tables.Count < 1 && DSReporte.Tables[0].Rows.Count == 0) { Dialogos.MostrarMensajeInformacion(Titulo, "No se encontraron coincidencias."); return; } ReportPath = Application.StartupPath + @"\Reportes\RptTarjaRebate.rdlc"; Cliente = ""; if (DSReporte.Tables[0].Rows.Count == 0 && DSReporte.Tables[1].Rows.Count == 0) { Dialogos.MostrarMensajeInformacion(Titulo, "No existen datos según los parametros ingresados"); return; } if (DSReporte.Tables[0].Rows.Count > 0) { RepDataSourceTarjas = new ReportDataSource("DsTarjas", DSReporte.Tables[0]); Cliente = DSReporte.Tables[0].Rows[0]["Cliente"].ToString(); } if (DSReporte.Tables[1].Rows.Count > 0) { RepDataSourceReBate = new ReportDataSource("DsRebates", DSReporte.Tables[1]); } Parameters = new ReportParameter[3]; Parameters[0] = new ReportParameter("Entidad", Cliente); Parameters[1] = new ReportParameter("Inicio", FechaEmisionIni.Value.ToShortDateString()); Parameters[2] = new ReportParameter("Fin", FechaEmisionFin.Value.ToShortDateString()); MView.ShowReporte(); ((PRO006RView)MView).ShowDialog(); } catch (Exception ex) { Dialogos.MostrarMensajeError(Titulo, "Ha ocurrido un error al mostrar el reporte.", ex); } }