public ResultPoliza ObtenerBytesReportePoliza(PolizaModelo Reporte, PersonalizaReporte PersonalizaReporte) { Implementations clsImplementations = new Implementations(); ResultPoliza result = new ResultPoliza(); string extensionReporte = ""; extensionReporte = Path.GetExtension(Reporte.RutaReporte); byte[] datosReporte = null; Area area = PersonalizaReporte.AreaRectangle; area.Y = 0.5f; string certificadoHtml = System.IO.File.ReadAllText(Reporte.RutaReporte); clsImplementations.AsignaParametros(ref certificadoHtml, Reporte); datosReporte = clsImplementations.ConvertirHTMLEnPDF( new PersonalizaReporte { Html = certificadoHtml, MostrarMarcaAgua = PersonalizaReporte.MostrarMarcaAgua, RutaImagenHeader = PersonalizaReporte.RutaImagenHeader, RutaTipoLetra = PersonalizaReporte.RutaTipoLetra, TextoHeader = PersonalizaReporte.TextoHeader, TextoHeaderTam = PersonalizaReporte.TextoHeaderTam, TextoMarcaAgua = PersonalizaReporte.TextoMarcaAgua, TextoFooter = PersonalizaReporte.TextoFooter, MostrarTextoFooter = PersonalizaReporte.MostrarTextoFooter, MostrarTextoHeader = PersonalizaReporte.MostrarTextoHeader, Pais = Reporte.Pais, AreaRectangle = area }); result.Datos = datosReporte; return(result); }
public byte[] generapoliza(PolizaModelo Reporte, PersonalizaReporte PersonalizaReporte, ComplementosPolizaBR item, string documentoId) { Implementations clsImplementations = new Implementations(); byte[] bytesLocal = clsImplementations.ReporteComplementoBrasil(Reporte, item); clsImplementations.BytesReportePolizaToDocumentStorage(item.Reporte.ToString(), documentoId, bytesLocal, PersonalizaReporte.MostrarMarcaAgua, Utilerias.Enums.TipoDocumentoStorage.POLAT); return(bytesLocal); }
public byte[] generademostrativacomisio(PolizaModelo Reporte, PersonalizaReporte PersonalizaReporte, ComplementosPolizaBR item, string documentoId) { Implementations clsImplementations = new Implementations(); byte[] comisionBytes = null; byte[] bytesLocal = null; PolizaModelo repBroker = new PolizaModelo(); repBroker.DESCRIPCION = Reporte.DESCRIPCION; repBroker.DATOSFIANZA = Reporte.DATOSFIANZA; repBroker.FIANZASIS = Reporte.FIANZASIS; repBroker.PARCELAS = Reporte.PARCELAS; repBroker.DATOSEMISORES = Reporte.DATOSEMISORES; repBroker.NombreFuenteDatos = Reporte.NombreFuenteDatos; repBroker.COASEGURADOS = Reporte.COASEGURADOS; var listaEmisores = Reporte.EMISORES; repBroker.Pais = "Brasil"; for (int f = 0; f < listaEmisores.Count; f++) { EmisoresRep emisor = listaEmisores[f]; repBroker.EMISORES = new List <EmisoresRep>(); repBroker.EMISORES.Add(emisor); repBroker.PARCELASCOMISIONES = Reporte.PARCELASCOMISIONES.Any(x => x.AGENTE == emisor.EXFL_NO_EMISOR) ? Reporte.PARCELASCOMISIONES.Where(x => x.AGENTE == emisor.EXFL_NO_EMISOR).ToList() : new List <ParcelasComision>(); bytesLocal = clsImplementations.ReporteComplementoBrasil(repBroker, item, Utilerias.Enums.Paises.Brasil); if (comisionBytes == null) { comisionBytes = bytesLocal; } else { comisionBytes = clsImplementations.ConcatenarReportes(comisionBytes, bytesLocal); } } bytesLocal = comisionBytes; clsImplementations.BytesReportePolizaToDocumentStorage(item.Reporte.ToString(), documentoId, bytesLocal, PersonalizaReporte.MostrarMarcaAgua, Utilerias.Enums.TipoDocumentoStorage.POLAT); return(bytesLocal); }
public byte[] generaboleto(PolizaModelo Reporte, PersonalizaReporte PersonalizaReporte, ComplementosPolizaBR item) { Implementations clsImplementations = new Implementations(); string documentoId = ""; ResultPoliza result = new ResultPoliza(); bool ParcelasShenaRPPA = false; bool reporteChubb = false; bool reporteChubb17 = false; string extensionReporte = Path.GetExtension(Reporte.RutaReporte); byte[] bytesLocal = null; byte[] reporteConcatenado = null; bytesLocal = null; var temp = Reporte.Parametros; Reporte.Parametros.Clear(); var SenhaRPPA = clsImplementations.ConsultarDatosAdicionalesFianza(new EmisionNuevos() { P_NO_FIANZA = Reporte.DESCRIPCION.FirstOrDefault().MFZA_NO_FIANZA, P_NO_INCLUSION = Reporte.DESCRIPCION.FirstOrDefault().MFZA_NO_INCLUSION, P_NO_MOVIMIENTO = Reporte.DESCRIPCION.FirstOrDefault().MFZA_NO_MOVIMIENTO, P_CVE_DETALLE = 44 }); if (SenhaRPPA != null && !string.IsNullOrEmpty(SenhaRPPA.RETURN_VALUE)) { if (Reporte.PARCELAS.Any(x => x.NO_PARCIALIDAD == 1)) { Reporte.PARCELAS.Remove(Reporte.PARCELAS.First(x => x.NO_PARCIALIDAD == 1)); ParcelasShenaRPPA = true; } } byte[] boletosBytes = null; foreach (Parcelas itemP in Reporte.PARCELAS) { if (reporteChubb) { Reporte.RutaReporte = clsImplementations.ObtieneRutaComplementoBrasil(item.Ruta); } else if (reporteChubb17) { Reporte.RutaReporte = clsImplementations.ObtieneRutaComplementoBrasil17(item.Ruta); } else { Reporte.RutaReporte = item.Ruta; } var parcialidad = ""; Reporte.Pais = "BrasilBoleto"; if (Reporte.Parametros.Exists(x => x.Nombre == "rpNumeroParcela")) { if (itemP.NO_PARCIALIDAD.ToString().Length == 1) { parcialidad = "0"; } Reporte.Parametros.Find(x => x.Nombre == "rpNumeroParcela").Valor = parcialidad + itemP.NO_PARCIALIDAD.ToString(); } else { if (itemP.NO_PARCIALIDAD.ToString().Length == 1) { parcialidad = "0"; } Reporte.Parametros.Add(new ParametrosReportes { Nombre = "rpNumeroParcela", Valor = parcialidad + itemP.NO_PARCIALIDAD.ToString() }); } if (Reporte.Parametros.Exists(x => x.Nombre == "rpFechaVencimiento")) { Reporte.Parametros.Find(x => x.Nombre == "rpFechaVencimiento").Valor = itemP.FECHA_PAGO.ToShortDateString(); } else { Reporte.Parametros.Add(new ParametrosReportes { Nombre = "rpFechaVencimiento", Valor = itemP.FECHA_PAGO.ToShortDateString() }); } if (Reporte.Parametros.Exists(x => x.Nombre == "rpValorParcela")) { Reporte.Parametros.Find(x => x.Nombre == "rpValorParcela").Valor = itemP.TOTAL.ToString(); } else { Reporte.Parametros.Add(new ParametrosReportes { Nombre = "rpValorParcela", Valor = itemP.TOTAL.ToString() }); } } bytesLocal = boletosBytes; clsImplementations.BytesReportePolizaToDocumentStorage(item.Reporte.ToString(), documentoId, bytesLocal, PersonalizaReporte.MostrarMarcaAgua, Utilerias.Enums.TipoDocumentoStorage.POLAT); return((reporteConcatenado == null) ? bytesLocal : clsImplementations.ConcatenarReportes(reporteConcatenado, bytesLocal)); }
public ResultPoliza ObtenerBytesReportePoliza(PolizaModelo Reporte, PersonalizaReporte PersonalizaReporte) { Implementations clsImplementations = new Implementations(); string documentoId = ""; ResultPoliza result = new ResultPoliza(); string extensionReporte = ""; extensionReporte = Path.GetExtension(Reporte.RutaReporte); byte[] bytesLocal = null; ReportViewer reportViewer = new ReportViewer(); reportViewer.ProcessingMode = ProcessingMode.Local; clsImplementations.CargarDataSourcePolizaLATAM(Reporte, ref reportViewer); reportViewer.LocalReport.ReportPath = Reporte.RutaReporte; PersonalizaReporte.Pais = Reporte.Pais; try { clsImplementations.AsignaParametros(ref reportViewer); var ListaComplementosOrden = clsImplementations.OrdenPolizaBrasil(Reporte.COMPLEMENTOS); byte[] reporteConcatenado = null; for (int i = 0; i < ListaComplementosOrden.Count(); i++) { ComplementosPolizaBR item = ListaComplementosOrden[i]; if (Reporte.FIANZASIS != null) { documentoId = string.Format("{0}{1}", Reporte.FIANZASIS.First().ID_DOCUMENTACION, (int)item.Reporte); } else { documentoId = "0"; } byte[] bytesStorage = null; if (documentoId.Length > 1) { bytesStorage = clsImplementations.BytesReportePolizaFromDocumentStorage(documentoId, Utilerias.Enums.TipoDocumentoStorage.POLAT); } if (bytesStorage != null) { bytesLocal = bytesStorage; reporteConcatenado = (reporteConcatenado == null) ? bytesLocal : clsImplementations.ConcatenarReportes(reporteConcatenado, bytesLocal); } else { switch (item.Reporte) { case ReportesComplementosBR.Boletos: cboleto objboleto = new cboleto(); reporteConcatenado = objboleto.generaboleto(Reporte, PersonalizaReporte, item); break; case ReportesComplementosBR.AnexaPoliza: case ReportesComplementosBR.DemostrativoFraccionamiento: cpoliza objpoliza = new cpoliza(); bytesLocal = objpoliza.generapoliza(Reporte, PersonalizaReporte, item, documentoId); reporteConcatenado = (reporteConcatenado == null) ? bytesLocal : clsImplementations.ConcatenarReportes(reporteConcatenado, bytesLocal); break; case ReportesComplementosBR.DemostrativoComision: cdemostrativacomisio objcdemostrativacomisio = new cdemostrativacomisio(); bytesLocal = objcdemostrativacomisio.generademostrativacomisio(Reporte, PersonalizaReporte, item, documentoId); reporteConcatenado = (reporteConcatenado == null) ? bytesLocal : clsImplementations.ConcatenarReportes(reporteConcatenado, bytesLocal); break; } } } byte[] resultBytes = null; if (reporteConcatenado != null) { resultBytes = reporteConcatenado; } if (resultBytes != null) { result.Datos = PersonalizaReporte.MostrarMarcaAgua ? clsImplementations.AgregarMarcaAgua(resultBytes, PersonalizaReporte.TextoMarcaAgua) : resultBytes; } } catch (Exception ex) { throw ex; } return(result); }