Blazor-Excel-export
Blazor-Excel-export copied to clipboard
Losing headers when writing Excel
Hi,
Nice demo, works well, just wanted to highlight that in the WeatherForecastXLS code:
ws.Cell(row + 1, 1).Value = "'" + data[row].Date.ToShortDateString();
Since the row starts at 0, +1 = Row 1, which is where you put your headers. So you wouldn't get any headers.
Would need to be:
ws.Cell(row + 2, 1).Value = "'" + data[row].Date.ToShortDateString();