Change column name for date range while exporting pdf or xls
Change column name for date range while exporting pdf or xls
cooldt
Posts: 4Questions: 2Answers: 0
Using Datatables with columnFilter and TableTools plugin. Table has date ranges as filters. While exporting to pdf the column name is "Expiry Date: From {from} to {to}", which doesnt look good in the report. Is there any way I can change this column name while exporting to pdf or xls. Below is my code.
//create new table
var table = $('#theListTable').dataTable( {
"dom": 'T<"clear">lfrtip',
"tableTools": {
"sSwfPath": "../swf/copy_csv_xls_pdf.swf",
"aButtons": [
{
"sExtends": "xls",
"sButtonText": "#{searchMsg['lbl.exportToExcel']}",
"oSelectorOpts": { filter: 'applied', order: 'current' }
},
{
"sExtends": "pdf",
"sButtonText": "#{searchMsg['lbl.exportToPdf']}",
"oSelectorOpts": { filter: 'applied', order: 'current' }
}
]
},
"columns": [
{ "title": "#{searchMsg['lbl.eventId']}" },
{ "title": "#{searchMsg['lbl.eventDate']}" },
]
} )
.columnFilter({ sPlaceHolder: "head:after",
aoColumns: [ {sType: "number"},
{type: "date-range", sRangeFormat: "#{searchMsg['lbl.eventDate']}" },
]
});
Column names appers in xls or pdf as below:
Event Number Event Date: From {from} to {to}
This discussion has been closed.