Search code examples
javascripthtmltabletools

Change the Table tools pdf title name in html


How to give table caption as pdf title in Table tools

as of now HTML page title is coming as pdf title.

I am generating pdf with this code

<script type="text/javascript" charset="utf-8">
    $(document).ready( function () {
        $('#example').dataTable( {
            "sDom": 'T<"clear">lfrtip',
            "oTableTools": {
            "sScrollY": 200,
            "sScrollX": "100%",
            "sScrollXInner": "110%",
            "sSwfPath": "../mymedia/savefiles/copy_csv_xls_pdf.swf"
            }
            } )
            .columnFilter({
                aoColumns: {{columnfilters|safe}}
        });
    } );
</script>

Solution

  • Use "sTitle" to override with name whatever you require... something like:

    "sTitle" : "Attribute report"