Skip to content
Discussion options

You must be logged in to vote

There's a couple of ways to achieve what you're asking. The most straightforward one is probably converting your data to a DataTable:

int[][] data = [[1, 2, 3], [4, 5, 6]];
var maxLen = data.Max(x => x.Length);
 
var dt = new DataTable();
 
for (int i = 0; i < maxLen; i++) 
    dt.Columns.Add(null, typeof(int));
 
foreach (var row in data) 
    dt.Rows.Add([..row]);
 
var conf = new OpenXmlConfiguration { AutoFilter = false, FreezeRowCount = 0 };
MiniExcel.SaveAs(yourPath, dt, printHeader: false, configuration: conf);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by michelebastione
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants