public void ToExcel(
string description = "Exported Data",
string fileName = "data.xlsx",
string worksheetName = "worksheet1",
string footer = "",
string header = "",
string numberformat = "#,##0",
string dateTimeFormat = "yyyy-MM-dd hh:mm",
string timeSpanFormat = "hh:mm:ss",
bool pageLayoutView = false,
bool showGridLines = false,
TableStyles tableStyle = TableStyles.Dark9
)
{
var exportToExcel = new ExportToExcel
{
DateTimeFormat = dateTimeFormat,
Description = description,
FileName = fileName,
Footer = footer,
Header = header,
Numberformat = numberformat,
PageLayoutView = pageLayoutView,
ShowGridLines = showGridLines,
TableStyle = tableStyle,
TimeSpanFormat = timeSpanFormat,
WorksheetName = worksheetName
};
_pdfReport.DataBuilder.CustomExportSettings.Add(exportToExcel);
}