how to export int[][] or List<List<int>> ? #835
-
|
I have this data: int[][] = [[1,2,3],[4,5,6]];i want export without header:
I need export mult int[][] to different sheet |
Beta Was this translation helpful? Give feedback.
Answered by
michelebastione
May 14, 2026
Replies: 1 comment
-
|
There's a couple of ways to achieve what you're asking. The most straightforward one is probably converting your data to a 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); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
michelebastione
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's a couple of ways to achieve what you're asking. The most straightforward one is probably converting your data to a
DataTable: