Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

New Post: How to expand the Range of a Work Table?

$
0
0
Did a little workaround, but not sure if this is the best practice... anyway.. :) hopefully somebody will make good use of this in the future. :)
var metrics = from m in data where m.CreatedDate > lastUpdate orderby m.CreatedDate ascending select new { m.LogType, m.Category, m.Item, m.UDC, m.CreatedBy.LookupValue, m.CreatedDate, m.VisitingUrl.Url, region = m.CreatedBy.LookupValue.Substring(0, m.CreatedBy.LookupValue.IndexOf("\\")) };
var nextRow = worktable.RowCount() + 1;
Console.WriteLine("Number of items to be added: " + metrics.Count());
if (metrics.Count() != 0)
{
         worktable.InsertRowsBelow(metrics.Count(), true);
         var tableWithData = worktable.Cell(nextRow, 1).InsertData(metrics.AsEnumerable());
         workbook.SaveAs(localPath);
}

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>