Closed suvonkar closed 7 years ago
@suvonkar I've added optional support for CSV file exports, see main Bootstrap demo for implementation details. Then CSV file can be converted to XLS or PDF format using Excel itself, if needed.
@AlexanderZhukCoherent , Thanks a lot for your help.
I would like to highlight something which is missing in the Demo. If you go to the CodePen then in the JS tab following section is missing.
$scope.exportToCsv = function (currentData) {
var exportData = [];
currentData.forEach(function (item) {
exportData.push({
'Code': item.code,
'Date Placed': $filter('date')(item.placed, 'shortDate'),
'Status': item.statusDisplay,
'Total': item.total.formattedValue
});
});
JSONToCSVConvertor(exportData, 'Export', true);
}
It will be helpful for others if you update the JS tab.
Thanks in advance.
@suvonkar thanks for the reminder, done!
@AlexanderZhukCoherent Are you able to make it so that it's possible to generate the CSV file without the first few lines (the date and the report title) so that the file itself is purely just data?
@erizabesu CSV export is just optional plug-in functionality, so it won't be a part of grid configuration etc. However, you can easily edit beginning of https://github.com/angular-data-grid/angular-data-grid.github.io/blob/master/src/js/vendors/JSONToCSVConvertor.js file to remove unwanted lines in the report.
Hi @AndreyChayko ,
Can we get a export to Excel, PDF, CSV etc. feature from this grid data?