Skip to content

excel导出报错 #21

Description

@dashenxian

版本:1.4.21
excel导出时,如果导出模型定义了ExporterHeader就会报错,这是反编译的报错的位置:
image

[AutoMap(typeof(Standard))]//这是automap的映射配置
[ExcelImporter(IsLabelingError = true)]//这个模型同时也用于导出模板
public class ImportExcelDto
{
        public const int MaxLength = 1024;
        /// <summary>
        /// 规程类型
        /// </summary>
        [MaxLength(MaxLength)]
        [Display(Name = "名称")]
        [ExporterHeader("名称")]
        public string Name { get; set; }
}
//导出文件
await exporter.Export("xxxx.xlsx", new List<ImportExcelDto>{new ImportExcelDto{Name="123"}});

如果模型没有定义ExporterHeader则不会报错

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions