How add a new row and columns with EPPlus C# and MVC?
<p>I use EPPlus version 4.0.4 to create an Excel file within an ASP.net MVC5 website and I simply don't know how to add a new rows and columns after completing the very first row. </p>

<p>It's difficult to explain clearly so let's me show you my code. It's easy enough to understand.</p>

<pre><code>    var products = new DataTable("1km subscriptions");

    // SO HERE THE FIRST COLUMS with ROWS INFORMATION
    products.Columns.Add("", typeof(int));
    products.Columns.Add("Full Name", typeof(string));
    products.Columns.Add("BirthDate", typeof(string));

    int i = 0;
    foreach (var item in GetData())
    {
        // Primary user info
        products.Rows.Add(i, item.FullName, item.BirthDate);
        i++;

        // HERE I HAVE TO GO TO NEXT LIGNE NUMBER AND WRITE TWO COLUMNS AND ROWS INFO
//products.NewRow();
        products.Columns.Add("ORDER #", typeof(int));
        products.Columns.Add("BUY DATE", typeof(string));

        foreach (var order in item.OrderViewModels)
        {
            products.Rows.Add(order.Id, order.CreatedDate);

//products.NewRow();
            // THEN, I HAVE TO DO THE SAME THING. GO TO THE NEXT LIGNE AND ADD TWO OTHERS COLUMNS WITH INFO
            products.Columns.Add("PRODUCT NAME", typeof(string));
            products.Columns.Add("Quantity", typeof(int));
            foreach (var osku in order.OrderSKUViewModels)
            {
                products.Rows.Add(osku.SKUName, osku.Quantity);
            }
        }
    }

    using (ExcelPackage pck = new ExcelPackage())
    {
        ExcelWorksheet ws = pck.Workbook.Worksheets.Add("FIRST TAB NAME");
        ws.Cells["A1"].LoadFromDataTable(products, true)
        // Write it back to the client
        Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
        Response.AddHeader("content-disposition", "attachment;  filename=ExcelDemo.xlsx");
        Response.BinaryWrite(pck.GetAsByteArray());
        Response.Flush();
        Response.End();
    }
</code></pre>

<p>At first, I was thinking the products.NewRow() will do the job but it's not the case. I don't find an easy we to do what that easy operation. I would like to avoid to do major changes to the code for something like that o_O</p>

<p>Anyone can help ?</p>

<p>David</p>

<h2>Edit</h2>

<p>I can't add a picture but I can share the HTML code I use to display the data. I try to reproduce the same architecture with Excel. So we can understand that I thought that product.NewLine() could produce a kind of line change... :</p>

<pre><code>&lt;table class="table table-hover" style="border: 1px solid #ddd;"&gt;
            @foreach (var item in Model)
            {
                &lt;tr class="success"&gt;
                    &lt;th style="width:122px;"&gt;Full Name&lt;/th&gt;
                    &lt;th style="width:118px;"&gt;BirthDate&lt;/th&gt;
                &lt;/tr&gt;
                &lt;tr class="active"&gt;
                    &lt;td&gt;@item.FullName&lt;/td&gt;  
                    &lt;td&gt;@item.BirthDate&lt;/td&gt;
                &lt;/tr&gt;
                foreach (var order in item.OrderViewModels)
                {
                    &lt;tr&gt;
                        &lt;td&gt;&lt;b&gt;Commande:&lt;/b&gt;&lt;/td&gt;
                        &lt;td&gt;&lt;b&gt;#&lt;/b&gt;&amp;nbsp;@order.Id&lt;/td&gt;
                        &lt;td colspan="6"&gt;&lt;b&gt;Buy date:&lt;/b&gt;&amp;nbsp;@order.CreatedDate&lt;/td&gt;
                    &lt;/tr&gt;
                        foreach (var osku in order.OrderSKUViewModels)
                        {
                        &lt;tr&gt;
                            &lt;td colspan="3"&gt;&lt;b&gt;Product name:&lt;/b&gt;&amp;nbsp;@osku.SKUName&lt;/td&gt;
                            &lt;td colspan="5"&gt;&lt;b&gt;Quantity:&lt;/b&gt;&amp;nbsp;@osku.Quantity&lt;/td&gt;
                        &lt;/tr&gt;
                        }
                    &lt;tr&gt;
                        @if (order.GuestViewModels.Count() != 0)
                        {
                            &lt;th colspan="8" class="success"&gt;Guests&lt;/th&gt;
                        }
                    &lt;/tr&gt;

                    if (order.GuestViewModels.Count() &gt; 0)
                    {
                        &lt;tr class="warning"&gt;
                            &lt;th style="width:122px;"&gt;FullName&lt;/th&gt;
                            &lt;th style="width:118px;"&gt;BirthDate&lt;/th&gt;
                        &lt;/tr&gt;
                    }
                    foreach (var guest in order.GuestViewModels)
                    {
                        &lt;tr style="border-top: 2px double  #0094ff;border-left:2px solid #0094ff;border-right:2px solid #0094ff"&gt;
                            &lt;td&gt;@guest.FullName&lt;/td&gt;
                            &lt;td&gt;@guest.BirthDate&lt;/td&gt;
                        &lt;/tr&gt;
                    }
                }
            }
        &lt;/table&gt;
</code></pre>