Exemplo n.º 1
0
    public async Task SpreadCheetah()
    {
        await using var spreadsheet = await Spreadsheet.CreateNewAsync(Stream.Null);

        await spreadsheet.StartWorksheetAsync(SheetName);

        var style = new Style();

        style.Font.Bold = true;
        var styleId = spreadsheet.AddStyle(style);
        var cells   = new StyledCell[NumberOfColumns];

        for (var row = 0; row < NumberOfRows; ++row)
        {
            for (var col = 0; col < NumberOfColumns; ++col)
            {
                var value = _values[row][col];
                cells[col] = new StyledCell(value, styleId);
            }

            await spreadsheet.AddRowAsync(cells);
        }

        await spreadsheet.FinishAsync();
    }
 public static ValueTask AddRowAsync(this Spreadsheet spreadsheet, StyledCell cell, RowOptions?options = null) => spreadsheet.AddRowAsync(new[] { cell }, options);