Skip to content

Freeze top row #620

Description

@stian-bay

Excel Type

  • XLSX
  • XLSM
  • CSV
  • OTHER

MiniExcel Version

Description

The autofilter and table style is really nice and it would be perfect if you could also add the posibility to freeze the top row. This makes it easier for the customer when working with large data sets.

And you can set it with either config or model spesific
[ExcelSheet(Name = "Data", FreezeTopRow = true)]

var config = new OpenXmlConfiguration()
{
    TableStyles = TableStyles.Default,
    AutoFilter = true,
    FreezeTopRow = true,
};

Although sidenote, I noticed it doesn't pick up the sheet name I set on top of the DataModelExport class if I use it like this:

var data = dbItems.Adapt<IEnumerable<DataModelExport>>();

var memoryStream = new MemoryStream();
memoryStream.SaveAs(data);
memoryStream.Seek(0, SeekOrigin.Begin);

return memoryStream;
var fileStream = excelService.Export(key);

return new FileStreamResult(fileStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
{
    FileDownloadName = $"Exported items - {DateTime.Now:dd.MM.yyyy HH:mm}.xlsx"
};

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions