Skip to content

使用QueryRange( )时,如果查询的范围只有一个column,结果会查询出所有column #463

@joeyni-tw

Description

@joeyni-tw

Excel Type

XLSX

MiniExcel Version

1.30.1

Description

使用QueryRange( )时,如果查询的范围只有一个column,结果会查询出所有column。

Example

static void Main()
{
    var path = "demo3.xlsx";

    // Would like to query all columns (A, B, C)
    {
        var rows = MiniExcel.QueryRange(path, startCell: "A1", endCell: "C3").ToList();
        foreach (var item in rows)
        {
            Console.WriteLine(item.A + ", " + item.B + ", " + item.C);
        }
        Console.WriteLine();
    }
    // OK

    // Would like to query column A and column B
    {
        var rows = MiniExcel.QueryRange(path, startCell: "A1", endCell: "B3").ToList();
        foreach (var item in rows)
        {
            Console.WriteLine(item.A + ", " + item.B + ", " + item.C);  // fail to query column C
        }
    }
    Console.WriteLine();
    // OK

    // Would like to query column A
    {
        var rows = MiniExcel.QueryRange(path, startCell: "A1", endCell: "A3").ToList();
        foreach (var item in rows)
        {
            Console.WriteLine(item.A + ", " + item.B + ", " + item.C);  // all columns
        }
    }
    // Bug
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions