Se corrige la forma en que se toma la imagen del logo de gemco y se agrega la ruta en el appSettings.json

feature/Reporte_Relacion_Facturas_Alen
Felix Morales 11 months ago
parent 8ddd7e615c
commit e91f28420f
  1. 19
      Controllers/Reportes/ReportesEmbarquesController.cs
  2. 1
      appsettings.Development.json
  3. 1
      appsettings.Staging.json
  4. 1
      appsettings.json

@ -14,8 +14,15 @@ namespace CORRESPONSALBackend.Controllers.Reportes{
[ApiController]
public class ReportesEmbarquesController : ControllerBase{
private readonly IReportesEmbarquesRepository _repo;
public ReportesEmbarquesController(IReportesEmbarquesRepository repo){
private readonly IConfiguration _config;
private readonly string RootPathCorresponsales;
private readonly string PathLogoGemco;
private readonly string LogoGemcoFileName = "LogoGemco.png";
public ReportesEmbarquesController(IReportesEmbarquesRepository repo, IConfiguration config){
_repo = repo;
_config = config;
RootPathCorresponsales = _config.GetValue<string>("AllFiles");
PathLogoGemco = _config.GetValue<string>("LogoGemco");
}
[HttpGet("PorImportar")]
@ -175,7 +182,7 @@ namespace CORRESPONSALBackend.Controllers.Reportes{
tab.TableStyle = TableStyles.Light1;
worksheet.Cells["A1:A6"].Merge = true;
//Se agrega el logo de GEMCO al documento.
ExcelPicture excelImage = worksheet.Drawings.AddPicture("Logo", new FileInfo("C:\\data\\Corresponsales\\Img\\LogoGemco.png"));
ExcelPicture excelImage = worksheet.Drawings.AddPicture("Logo", new FileInfo(RootPathCorresponsales + PathLogoGemco + LogoGemcoFileName));
excelImage.SetPosition(0,0,1,0);
//Aqui comienza el encabezado del documento.
worksheet.Cells["B1:D6"].Merge = true;
@ -356,7 +363,7 @@ namespace CORRESPONSALBackend.Controllers.Reportes{
tab.TableStyle = TableStyles.Light1;
worksheet.Cells["A1:A6"].Merge = true;
//Se agrega el logo de GEMCO al documento.
ExcelPicture excelImage = worksheet.Drawings.AddPicture("Logo", new FileInfo("C:\\data\\Corresponsales\\Img\\LogoGemco.png"));
ExcelPicture excelImage = worksheet.Drawings.AddPicture("Logo", new FileInfo(RootPathCorresponsales + PathLogoGemco + LogoGemcoFileName));
excelImage.SetPosition(0,0,1,0);
//Aqui comienza el encabezado del documento.
worksheet.Cells["B1:D6"].Merge = true;
@ -492,7 +499,7 @@ namespace CORRESPONSALBackend.Controllers.Reportes{
tab.TableStyle = TableStyles.Light1;
worksheet.Cells["A1:A6"].Merge = true;
//Se agrega el logo de GEMCO al documento.
ExcelPicture excelImage = worksheet.Drawings.AddPicture("Logo", new FileInfo("C:\\data\\Corresponsales\\Img\\LogoGemco.png"));
ExcelPicture excelImage = worksheet.Drawings.AddPicture("Logo", new FileInfo(RootPathCorresponsales + PathLogoGemco + LogoGemcoFileName));
excelImage.SetPosition(0,0,1,0);
//Aqui comienza el encabezado del documento.
worksheet.Cells["B1:D6"].Merge = true;
@ -504,7 +511,7 @@ namespace CORRESPONSALBackend.Controllers.Reportes{
worksheet.Cells["E6:J6"].Merge = true;
worksheet.Cells["E1:J6"].Style.Font.Size = 16;
worksheet.Cells["E1:J6"].Style.Font.Color.SetColor(Color.FromArgb(74,74,173));
worksheet.Cells["E2"].Value = "REPORTE DE EMBARQUES POR DESPACHADOS";
worksheet.Cells["E2"].Value = "REPORTE DE EMBARQUES";
worksheet.Cells["E3"].Value = $"Reporte Generado al: {today.Day}/{today.Month}/{today.Year}";
worksheet.Cells["E4"].Value = $"Fecha y Hora de Creación: {today.Day}/{today.Month}/{today.Year} {today.Hour}:{today.Minute}:{today.Second}";
worksheet.Cells["A1:BK6"].Style.Fill.PatternType = ExcelFillStyle.Solid;
@ -517,7 +524,7 @@ namespace CORRESPONSALBackend.Controllers.Reportes{
var stream = new MemoryStream();
excelPackage.SaveAs(stream);
stream.Position = 0;
return File(stream, "application/octet-stream", "ReporteEmbarquesDespachados.xlsx");
return File(stream, "application/octet-stream", "ReporteEmbarques.xlsx");
}
}catch(Exception ex){

@ -16,6 +16,7 @@
"pathZipCorresponsales": "C:\\data\\",
"CorresponsalesFilePath": "C:\\data\\",
"Allfiles": "C:\\data\\",
"LogoGemco": "Corresponsales\\Img\\",
"Twilio_SID": "AC59baecf4872fa93e3c315180c96b4cc2",
"Twilio_Token": "5416fe0460e9afaf5400697def878c04",
"EmailAPI" : "https://pyapi.gemcousa.mx/"

@ -16,6 +16,7 @@
"pathZipCorresponsales": "D:\\data\\Corresponsales\\Zips\\",
"CorresponsalesFilePath": "D:\\data\\Corresponsales\\",
"AllFiles": "D:\\data\\",
"LogoGemco": "Corresponsales\\Img\\",
"Twilio_SID": "AC59baecf4872fa93e3c315180c96b4cc2",
"Twilio_Token":"5416fe0460e9afaf5400697def878c04",
"EmailAPI" : "https://pyapi.gemcousa.mx/"

@ -27,6 +27,7 @@
"pathZipCorresponsales": "D:\\data\\Corresponsales\\Zips\\",
"CorresponsalesFilePath": "D:\\data\\Corresponsales\\",
"AllFiles": "D:\\data\\",
"LogoGemco": "Corresponsales\\Img\\",
"Twilio_SID": "AC59baecf4872fa93e3c315180c96b4cc2",
"Twilio_Token": "5416fe0460e9afaf5400697def878c04",
"EmailAPI" : "https://pyapi.gemcousa.mx/"

Loading…
Cancel
Save