【问题标题】:Read Excel template using Aspose使用 Aspose 读取 Excel 模板
【发布时间】:2017-03-02 12:57:10
【问题描述】:

假设我有一个名为 User 的类:

public class User
{
        public int ID { get; set; }
        public string Name { get; set; }
        public string Email { get; set; }
        public int? Age { get; set; }
}

还有一个 Excel 表格,其中第一列是 ID,第二列是名称,第三列是电子邮件,第四列是年龄

有没有办法告诉 Aspose 使用此模板并根据此 Excel 模板填充类型为 User 的列表,以便我可以将其保存到数据库中?

【问题讨论】:

    标签: c# sql excel aspose


    【解决方案1】:

    如果您需要将自定义对象集合中的数据导入工作表,您可以尝试使用 Aspose.Cells API 提供的 Cells.ImportCustomObjects 方法。您将为该方法提供一个列/属性列表,以相应地在工作表中显示所需的对象列表,请参阅主题here 供您参考。

    我在 Aspose 担任支持开发人员/宣传员。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-05
      • 2020-01-20
      • 1970-01-01
      相关资源
      最近更新 更多