Generate Excel from record
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 05:48 AM
Hi,
I have a record producer. I want to generate a excel of the submitted values after submitting the record. how to do?
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 11:11 PM
Hi,
I have tried below script.. but not working..
ar fileName = 'Test.xls';
var Headers = ["Article Number", "Item Number", "Crushable"];
var xlsData = '';
for (var i = 0; i < Headers.length; i++) { //Build the Headers
xlsData = xlsData + '"' + Headers[i] + '"' + ',';
}
xlsData = xlsData + "\r\n";
for (i = 0; i < rowsInt; i++) {
xlsData = xlsData + '"' + "" + '",' + '"' + producer.crushable_change_request.getRow(i).item_number + '",' + '"' + producer.crushable_change_request.getRow(i).crushable;
xlsData = xlsData + "\r\n";
}
//attach the file to a record.
var grAttachment = new GlideSysAttachment();
grAttachment.write(current, current.number+'.xls','test/csv', xlsData);