Blazor-Excel-export icon indicating copy to clipboard operation
Blazor-Excel-export copied to clipboard

Losing headers when writing Excel

Open Kaotic3 opened this issue 3 years ago • 0 comments

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();

Kaotic3 avatar Jun 16 '22 08:06 Kaotic3