static private void FillOutMuestraFluidos(this Autofill autofill, string fullPath) { try { var excel = OpenXMLSpreadsheet.Open(fullPath); var tasks = ReportingRepository.GetCNIHFluido(); int i = 4; foreach (var task in tasks) { excel.SetCell($"A{i}", "Vista Oil & Gas Holding II, S.A. de C.V."); excel.SetCell($"B{i}", "Vernet-1001EXP"); excel.SetCell($"C{i}", "590480190000200"); excel.SetCell($"D{i}", "CNH-R02-L03-CS-01/2017"); excel.SetCell($"E{i}", task.Get <string>("archivoLaboratorio", String.Empty).ToUpper()); excel.SetCell($"F{i}", task.Get <string>("tipoMuestras", String.Empty).ToUpper()); excel.SetCell($"G{i}", task.Get <string>("fechaMuestreo", String.Empty).ToUpper()); excel.SetCell($"H{i}", task.Get <string>("fechaEntrega", String.Empty).ToUpper()); excel.SetCell($"I{i}", task.Get <string>("caja", String.Empty).ToUpper()); excel.SetCell($"J{i}", task.Get <string>("intervaloProbado", String.Empty).ToUpper()); excel.SetCell($"K{i}", task.Get <string>("cantidadMuestra", String.Empty).ToUpper()); excel.SetCell($"P{i}", task.Get <string>("condicionesTomaMuestra", String.Empty).ToUpper()); excel.SetCell($"R{i}", task.Get <string>("observaciones", String.Empty).ToUpper()); i++; } excel.Save(); excel.Close(); } catch (Exception e) { throw e; } }