MiniExcel icon indicating copy to clipboard operation
MiniExcel copied to clipboard

Freeze panes missing async implementation

Open BaatenHannes opened this issue 4 months ago • 0 comments

Excel Type

  • [x] XLSX
  • [ ] XLSM
  • [ ] CSV
  • [ ] OTHER

MiniExcel Version

1.34.2

Description

PR #620 implemented the ability to freeze rows and columns. This feature seems to be missing in the async implementation (ExcelOpenXmlSheetWriter.Async.cs).

Using the configuration with the MemoryStream.SaveAsAsync() method doesn't freeze any rows or columns:

        var stream = new MemoryStream();
        var lines = new List<DigitaleWoonstcontroleExcelLine>();
        
        foreach (var row in rows)
        {
            lines.AddRange(CreateRowObject(row));
        }

        var config = new OpenXmlConfiguration()
        {
            FreezeRowCount = 3,
            FreezeColumnCount = 3
        };
        
        await stream.SaveAsAsync(lines, printHeader: true, sheetName: SheetName, ExcelType.XLSX, config, cancellationToken: cancellationToken);
        stream.Seek(0, SeekOrigin.Begin);
        return stream;

BaatenHannes avatar Oct 09 '24 11:10 BaatenHannes