I use Jquery Datatables to generate my grids, and for sure to generate Excel and PDF exported reports, what I need now is to automatically append a generic static content into the footer, that is not related to specific columns, but to the table footer as a whole, like a disclaimer comment or a generic note.
In order to generate the Excel Exports, for example, I use the following:
var buttons = new $.fn.dataTable.Buttons(dt, {
buttons: [
{
text: 'Export as CSV',
action: function (e, dt, button, config)
{
var ths = this;
dt.one('preXhr', function (e, s, data)
{
data.iDisplayLength = -1;
}).one('draw', function (e, settings, json, xhr)
{
var excelButtonConfig = $.fn.DataTable.ext.buttons.excelHtml5;
var addOptions = {footer: true, exportOptions: { 'columns': 'thead th:not(.noExport)', orthogonal: 'export'},'title': 'doc title', 'filename': 'filr name' };
$.extend(true, excelButtonConfig, addOptions);
excelButtonConfig.action.call(ths,e, dt, button, excelButtonConfig);
}).draw(false);
}
}
]
}).container().appendTo(<the button>);
Nothing worked for me so far.