Skip to content

Asynchronous saving does not support wrap text style #794

@kasimLZ

Description

@kasimLZ

Excel Type

  • XLSX
  • XLSM
  • CSV
  • OTHER

MiniExcel Version

1.41.2

Description

looks due that doesn't interpret the style definition correctly in GenerateCellXfAsync. i create a simple change for fix that. please review #795

using MiniExcelLibs;
using MiniExcelLibs.OpenXml;

var data = new List<Dictionary<string, string>>
{
    new()
    {
        { "Column1", "Value1\nValue1 Row2" },
        { "Column2", "Value2" },
        { "Column3", "Value3" },
    },
    new()
    {
        { "Column1", "Value4\nValue4 Row2" },
        { "Column2", "Value5" },
        { "Column3", "Value6" },
    }
};

MiniExcel.SaveAs(
    "test1.xlsx",
    value: data,
    printHeader: true,
    excelType: ExcelType.XLSX,
    sheetName: "sync_sheet",
    configuration: new OpenXmlConfiguration()
    {
        StyleOptions = new OpenXmlStyleOptions()
        {
            WrapCellContents = true
        }
    });

await MiniExcel.SaveAsAsync(
    "test2.xlsx",
    value: data,
    printHeader: true,
    excelType: ExcelType.XLSX,
    sheetName: "async_sheet",
    configuration: new OpenXmlConfiguration()
    {
        StyleOptions = new OpenXmlStyleOptions()
        {
            WrapCellContents = true
        }
    });

Image

Image

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