Skip to content

The program is looping when I use existingHeadingRows #80

@tuandomvn

Description

@tuandomvn

I am trying to use your nuget and its really fast. However I have 1 issue when trying to maintain the header in exel template so I put value to existingHeadingRows
The below code that I am using

using (FastExcel.FastExcel fastExcel = new FastExcel.FastExcel(new FileInfo("myworkbook.xlsx"), new FileInfo("Output.xlsx")))
{
    var table = new DataTable();
    table.Columns.Add("Product", typeof(string));
    table.Columns.Add("Variety1", typeof(decimal));
    table.Columns.Add("Variety2", typeof(decimal));
    table.Columns.Add("Variety3", typeof(decimal));
    table.Columns.Add("Variety4", typeof(decimal));

    for (int columnNumber = 1; columnNumber < 13; columnNumber++)
    {
        table.Rows.Add("Product 1", 10, 12, 14, 45);
    }

    worksheet.PopulateRowsFromDataTable(table, 5);

    fastExcel.Write(worksheet, "MySheet", 5);
}

I also attach my sample code
ConsoleApp2_FastExel.zip

Can you please have a look? Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions