20.11.2020, 06:57
You can use .lp file to generate a CSV that will be sent to the user.
First you need to attach an event to a button that will open .lp in a new window:
Use this as a starting point for csv.lp:
First you need to attach an event to a button that will open .lp in a new window:
Code:
$(function() {
// additional class must be set to csv
$('.csv').on('vclick', function() {
window.open('/user/csv.lp');
});
});
Use this as a starting point for csv.lp:
Code:
<?
-- set headers for csv file download
setdlheader('text/csv; charset=utf-8', 'report', 'csv')
-- generate csv here
csv = '...'
-- output to the user
print(csv)