Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7. 创建多个工作表(Sheet),这个功能亲测不可用 #669

Open
g123413927 opened this issue Sep 4, 2024 · 2 comments
Open

7. 创建多个工作表(Sheet),这个功能亲测不可用 #669

g123413927 opened this issue Sep 4, 2024 · 2 comments

Comments

@g123413927
Copy link

  1. 创建多个工作表(Sheet)
    // 1. Dictionary<string,object>
    var users = new[] { new { Name = "Jack", Age = 25 }, new { Name = "Mike", Age = 44 } };
    var department = new[] { new { ID = "01", Name = "HR" }, new { ID = "02", Name = "IT" } };
    var sheets = new Dictionary<string, object>
    {
    ["users"] = users,
    ["department"] = department
    };
    MiniExcel.SaveAs(path, sheets);

// 2. DataSet
var sheets = new DataSet();
sheets.Add(UsersDataTable);
sheets.Add(DepartmentDataTable);
//..
MiniExcel.SaveAs(path, sheets);

以上是描述,我建立了一个demo,结果如图所示

1111

根本不是写入多个sheet!!!!

@jiaguangli
Copy link
Member

发个demo谢谢

@CriSLyx
Copy link

CriSLyx commented Sep 26, 2024

直接贴进C#就可以了 完全没得问题
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants