I have the following code that excel generates to me with a title bar. Header column names are called variables in the DataItem class.
public class DataItem
{
public int Number { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Country { get; set; }
}
var rows = database.GetData().ToList();
ws.Cells["A1"].LoadFromCollection(rows, true, TableStyles.Medium25);
excel header output:
Number | FirstName | LastName | Country
How my output can be customized, for example (added spaces, etc.):
Number | First Name | Last Name | Country
source
share