title: Insert row at the end of an excel C# .NET
body: <p>Good morning everyone!</p>
  <p>I am trying to add a new row to an excel at the end of all data.</p>
  <p>As you can see, the excel has a header and then all the records from the &quot;billingSummary&quot;. At the end of the latter, I would like to add a row to calculate the totals.</p>
  <pre><code>var excelDataRows = new List&lt;ExcelDataTableRow&gt;
          {
              new ExcelDataTableRow
              {
                  CellValues = new List&lt;string&gt;
                  {
                      &quot;Fecha&quot;,
                      &quot;Contrato&quot;,
                      &quot;Consorcio&quot;,
                      &quot;Unidad&quot;,
                      &quot;Importe Cobrado&quot;,
                      &quot;Comisión Plataforma&quot;,
                      &quot;Neto&quot;,
                      &quot;Factura&quot;
                  }
              }
          };
  
          excelDataRows.AddRange(billingSummary.OrderBy(x =&gt; x.PaymentDate)
              .ThenBy(x =&gt; x.OwnersAssociationCode)
              .ThenBy(x =&gt; x.FunctionalUnitCode)
              .Select(item =&gt; new ExcelDataTableRow
              {
                  CellValues = new List&lt;string&gt;
                  {
                      item.PaymentDate.Day.ToString() + '/' + item.PaymentDate.Month.ToString() + '/' + item.PaymentDate.Year.ToString(),
                      item.ContractCode.ToString(),
                      item.OwnersAssociationCode.ToString(),
                      item.FunctionalUnitCode.ToString(),
                      item.TotalAmount.ToStringCurrency(),
                      item.PlapsaComission.ToStringCurrency(),
                      item.NetAmount.ToStringCurrency(),
                      item.Type + ' ' + item.PointOfSale + '-' + item.Number,
                  }
              }));
  
          //excelDataRows = new List&lt;ExcelDataTableRow&gt;
          //{
          //    new ExcelDataTableRow
          //    {
          //        CellValues = new List&lt;string&gt;
          //        {
          //            &quot;HOLA&quot;,
          //            &quot;CHAU&quot;
          //        }
          //    }
          //};
  
          return excelDataRows;
  </code></pre>
  <p>I hope you can help me! Thank you!</p>