Skip to content

ugurhangul/DictionaryToExcel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ougha.DictionaryToExcel NuGet version

Create Excel from Dictionary Forked from https://github.com/mustaddon/ArrayToExcel Thanks to Leonid Salavatov

Example #1 for Umbraco Properties

var list = new List<Dictionary<string, string>>();

foreach (var child in children.ToList())
{
    var dic = new Dictionary<string, string>();
    dic.Add("Name", child.Name);
    child.Properties.ForEach(c => dic.Add(c.PropertyType.Name, (c.GetValue() == null ? "-" : c.GetValue().ToString())));
    list.Add(dic);
}

var excel = list.ToExcel();

Example #2

var list = new List<Dictionary<string, string>>();
var dictionary = new Dictionary<string, string>();

dictionary.Add("HeaderName", "Value");
list.Add(dictionary);

var excel = list.ToExcel();

About

Create Excel from Dictionary<string,string>

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%