{"id":23740212,"url":"https://github.com/mustaddon/arraytoexcel","last_synced_at":"2025-04-05T08:07:47.246Z","repository":{"id":55073707,"uuid":"238197120","full_name":"mustaddon/ArrayToExcel","owner":"mustaddon","description":"Create Excel from Array (List, DataTable, DataSet, ...)","archived":false,"fork":false,"pushed_at":"2024-12-06T10:23:21.000Z","size":320,"stargazers_count":38,"open_issues_count":0,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T07:08:12.768Z","etag":null,"topics":["array","converter","dataset","datatable","dictionary","dotnet","excel","list","xlsx"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mustaddon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-04T12:09:23.000Z","updated_at":"2025-01-10T05:01:49.000Z","dependencies_parsed_at":"2024-01-08T14:29:37.408Z","dependency_job_id":"f7de540c-b1a7-43aa-a92b-854103349eae","html_url":"https://github.com/mustaddon/ArrayToExcel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustaddon%2FArrayToExcel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustaddon%2FArrayToExcel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustaddon%2FArrayToExcel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustaddon%2FArrayToExcel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mustaddon","download_url":"https://codeload.github.com/mustaddon/ArrayToExcel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305934,"owners_count":20917208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","converter","dataset","datatable","dictionary","dotnet","excel","list","xlsx"],"created_at":"2024-12-31T09:47:29.475Z","updated_at":"2025-04-05T08:07:47.218Z","avatar_url":"https://github.com/mustaddon.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ArrayToExcel [![NuGet version](https://badge.fury.io/nu/ArrayToExcel.svg?250)](http://badge.fury.io/nu/ArrayToExcel)\nCreate Excel from Array (List, DataTable, DataSet, ...)\n\n### Example 1: Create with default settings\n```C#\nusing ArrayToExcel;\n\nvar items = Enumerable.Range(1, 10).Select(x =\u003e new\n{\n    Prop1 = $\"Text #{x}\",\n    Prop2 = x * 1000,\n    Prop3 = DateTime.Now.AddDays(-x),\n});\n\nvar excel = items.ToExcel();\n```\nResult:\n[example1.xlsx](https://github.com/mustaddon/ArrayToExcel/raw/master/Examples/example1.xlsx)\n\n![](https://raw.githubusercontent.com/mustaddon/ArrayToExcel/master/Examples/example1.png)\n\n\n### Example 2: Rename sheet and columns\n```C#\nvar excel = items.ToExcel(schema =\u003e schema\n    .SheetName(\"Example name\")\n    .ColumnName(m =\u003e m.Name.Replace(\"Prop\", \"Column #\")));\n```\nResult:\n[example2.xlsx](https://github.com/mustaddon/ArrayToExcel/raw/master/Examples/example2.xlsx)\n\n![](https://raw.githubusercontent.com/mustaddon/ArrayToExcel/master/Examples/example2.png)\n\n\n### Example 3: Sort columns\n```C#\nvar excel = items.ToExcel(schema =\u003e schema\n    .ColumnSort(m =\u003e m.Name, desc: true));\n```\nResult:\n[example3.xlsx](https://github.com/mustaddon/ArrayToExcel/raw/master/Examples/example3.xlsx)\n\n![](https://raw.githubusercontent.com/mustaddon/ArrayToExcel/master/Examples/example3.png)\n\n\n### Example 4: Custom column's mapping\n```C#\nvar excel = items.ToExcel(schema =\u003e schema\n    .AddColumn(\"MyColumnName#1\", x =\u003e new CellHyperlink($\"https://www.google.com/search?q={x.Prop1}\", x.Prop1))\n    .AddColumn(\"MyColumnName#2\", x =\u003e $\"test:{x.Prop2}\")\n    .AddColumn(\"MyColumnName#3\", x =\u003e x.Prop3));\n```\nResult:\n[example4.xlsx](https://github.com/mustaddon/ArrayToExcel/raw/master/Examples/example4.xlsx)\n\n![](https://raw.githubusercontent.com/mustaddon/ArrayToExcel/master/Examples/example4.png)\n\n\n### Example 5: Additional sheets\n```C#\nvar excel = items.ToExcel(schema =\u003e schema\n    .SheetName(\"Main\")\n    .AddSheet(extraItems));\n```\nResult:\n[example5.xlsx](https://github.com/mustaddon/ArrayToExcel/raw/master/Examples/example5.xlsx)\n\n![](https://raw.githubusercontent.com/mustaddon/ArrayToExcel/master/Examples/example5.png)\n\n\n### Example 6: Create from DataSet\n```C#\nvar dataSet = new DataSet();\n\nfor (var i = 1; i \u003c= 3; i++)\n{\n    var table = new DataTable($\"Table{i}\");\n    dataSet.Tables.Add(table);\n\n    table.Columns.Add($\"Column {i}-1\", typeof(string));\n    table.Columns.Add($\"Column {i}-2\", typeof(int));\n    table.Columns.Add($\"Column {i}-3\", typeof(DateTime));\n\n    for (var x = 1; x \u003c= 10 * i; x++)\n        table.Rows.Add($\"Text #{x}\", x * 1000, DateTime.Now.AddDays(-x));\n}\n\nvar excel = dataSet.ToExcel();\n```\nResult:\n[example6.xlsx](https://github.com/mustaddon/ArrayToExcel/raw/master/Examples/example6.xlsx)\n\n![](https://raw.githubusercontent.com/mustaddon/ArrayToExcel/master/Examples/example6.png)\n\n\n[Example.ConsoleApp](https://github.com/mustaddon/ArrayToExcel/tree/master/Examples/Example.ConsoleApp/Program.cs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmustaddon%2Farraytoexcel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmustaddon%2Farraytoexcel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmustaddon%2Farraytoexcel/lists"}