Skip to content

设置 ShowInputMessage 后,MaxCount 不能小于 200 #618

Description

@staoran

Expected behaviour

设置 ShowInputMessage 后,会给数据行单元格一个提示信息

Image 所有存在提示信息的空行不应被识别为有效的数据行

Actual behaviour

现在的逻辑:
设置 ShowInputMessage 后,会在前 200 行设置单元格的提示信息。
在导入数据时,哪怕只录入了两行数据,也会识别为有200行数据。
如果同时设置了 MaxCount = 50 ,则会报错:The maximum number of allowed imports cannot be exceeded50!

Image Image

I'm seeing this behaviour on

  • Magicodes.IE.Excel
  • Magicodes.IE.Pdf
  • Magicodes.IE.Word
  • Magicodes.IE.Csv
  • Magicodes.IE.Html
  • Magicodes.IE.AspNetCore

package versions

Magicodes.IE.AspNetCore 2.8.5

So how can we reproduce this?

[ExcelImporter(
    MaxCount = 50,
    IsLabelingError = true
)]
public class ArriveOrderImport
{
    /// <summary>
    /// 货主手机号
    /// </summary>
    [Required]
    [MaxLength(32)]
    [ImporterHeader(
        Name = "货主手机号",
        Description = "填写货主在系统中的手机号,必须能匹配到已存在的用户,用于生成订单并发送通知",
        ShowInputMessage = "请输入已存在的货主手机号",
        IsInterValidation = true,
        AutoTrim = true,
    )]
    public string CargoOwner { get; set; } = string.Empty;
}

Metadata

Metadata

Assignees

No one assigned

    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