excel report
#5515
-
hi everyone |
Beta Was this translation helpful? Give feedback.
Answered by
luongnv6
Feb 22, 2021
Replies: 1 comment 1 reply
-
Here is code for you public FileContentResult ListExcel(IDbConnection connection, ListRequest request)
{
var data = List(connection, request).Entities;
var includeColumns = request.IncludeColumns.Where(p => p != "ImageColumnName");
var report = new DynamicDataReport(data, includeColumns, typeof(Columns.OutsideSalesReportColumns));
using (var excelPackage = new ReportRepository().RenderExcelPackage(report))
{
return ExcelContentResult.Create(excelPackage.GetAsByteArray(), $"ExcelNameFile_{DateTime.Now:yyyyMMdd_HHmmss}.xlsx");
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
samaremad
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is code for you