Adding to print: dynamically set information set outside the table

Adding to print: dynamically set information set outside the table

cwelrodcwelrod Posts: 4Questions: 0Answers: 0
edited August 2010 in TableTools
Allan,

I have page with dynamically set information outside of the datatable. How could I include that information in the print out?

Thank you.

-----------------------------------------------------------------------Reference--------------------------------------------------

----------------------------------------------------------------------Setup-------------------------------------------------------

var aSnapshotDataSet;

TableToolsInit.sSwfPath="../TableTools/media/swf/ZeroClipboard.swf";

$('#snapshot_table').html( '' );

/*
TableToolsInit.sPrintMessage = 'Snapshot Report:' + '
' +
$('#li_rr_period').text()+ ' ' + $('#span_rr_period').text() + '
' +
$('#li_rr_date').text() + ' ' + $('#span_rr_date').text() + '
' +
$('#li_rr_time').text() + ' ' + $('#span_rr_time').text() + '
' +
$('#li_rr_mail_out_date').text() + ' ' + $('#span_rr_mail_out_date').text( + '
'+ $('#li_rr_work_days').text() + ' ' + $('#span_rr_work_days').text() + '
';

*/


snapshotTable = $('#snapshot_data').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers",
sDom": 'T<"clear"><"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>',
"bPaginate":true,
"bFilter":false,
"aaData": aSnapshotDataSet,
"aoColumns": [
{ "sTitle": "Mode of Collection", "sClass":"snapshot_td_mode_of_collection" },
{ "sTitle": "Requested", "sClass":"snapshot_td_requested" },
{ "sTitle": "Successful","sClass":"snapshot_td_successful" },
{ "sTitle": "PCT Successful","sClass":"snapshot_td_pct_successful" },
{ "sTitle": "Usable","sClass":"snapshot_td_usable" },
{ "sTitle": "PCT Usable","sClass":"snapshot_td_pct_usable" },
{ "sTitle": "Eligible","sClass":"snapshot_td_eligible" }
]
} );



} );
--------------------------------------Report Display--------------------------------------------------------------------



Period:
Login Date:
Login Time:





Mail Out Date:
Number of Days Between:

Replies

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Hi cwelrod,

    At this moment in time it isn't possible with the current TableTools code to have certain information also included - at lest, TableTools has no knowledge of that. Good idea for an enhancement though! I've added it to my to do list. Until then, it would require a hack in the code not to hide your display elements.

    Allan
  • cwelrodcwelrod Posts: 4Questions: 0Answers: 0
    Allan,

    Ok, fair enough - I hacked TableTools.js to get this effect.

    Do you know why the table column headers are in the print view screen generated by TableTools.js but not in the IE7 printed page?


    Thank you,
    Chris

    --------------------Hacking to keep stuff in the print layouut
    /*
    * Function: fnPrintHideNodes
    * Purpose: Hide nodes which are not needed in order to display the table
    * Returns: -
    * Inputs: node:nNode - the table node - we parse back up
    * Notes: Recursive
    */
    function fnPrintHideNodes( nNode )
    {
    var nParent = nNode.parentNode;
    var nChildren = nParent.childNodes;

    /*
    * Hack by Chris Elrod:
    */

    //alert("nNode is " + nNode.id);

    /**************************************************/
    for ( var i=0, iLen=nChildren.length ; i
This discussion has been closed.