How to print the datas in the datatable?????.......

How to print the datas in the datatable?????.......

virusvirus Posts: 21Questions: 0Answers: 0
edited July 2010 in General
HI all.


I am trying to print the datas in the datatble ,i dont want to print next prvious pagenumbersfirst and last.How i can do this..

am having the code like, any one can help me , please..


[code]









window.opener.document.getElementById("btnDiv").style.display="none";



var myOldString = window.opener.document.getElementById("Content").innerHTML;



var lowerstr = myOldString.toLowerCase();

var myNewString = lowerstr.replace('show 102550100 entriessearch: ','History".$SurrenderDetails."');

var myNewString1 = myNewString.replace('border="0"','border="1" cellspacing="1" cellpadding="1"');

var myNewString2 = myNewString1.replace('','');

var myNewString3 = myNewString2.replace('firstprevious12nextlast','');

var myNewString4 = myNewString3.replace('previous12nextlast','');

document.write(myNewString4);

window.opener.document.getElementById("btnDiv").style.display="block";

function showBtn()

{

window.opener.document.getElementById("btnDiv").style.display="block";

window.print();

}







[/code]

Replies

  • S.I.DS.I.D Posts: 6Questions: 0Answers: 0
    Hi asifali,
    I dint get wht exactly u want to say....Do u want to print the table without the pagination buttons ?

    well I never did this, but the only logic I can think of is -
    On Click of the print button run a Jquery function which is used for pagination and disable pagination, and again after print function ends enable it.
    U can find jquery for pagination in jquery.js

    Do let us know when u get a solution
  • virusvirus Posts: 21Questions: 0Answers: 0
    HI S.I.D

    What am doing is in datatable. While printing, i don want to display the datatable o, i need only the content. Pagination searching should not be there. I hide the search and dropdown for pagination. in the head part. but i cannot do that in the footer pagination..

    I avoid the header like this
    [code]


    window.opener.document.getElementById("btnDiv").style.display="none";



    var myOldString = window.opener.document.getElementById("Content").innerHTML;



    var lowerstr = myOldString.toLowerCase();



    var myNewString = lowerstr.replace('show 102550100 entriessearch: ','');

    document.write(myNewString);
    [/code]
  • S.I.DS.I.D Posts: 6Questions: 0Answers: 0
    Hey asifali,

    Chk this out, I just tried this in my datatable and it worked
    [code]
    document.getElementById("dataGrid_paginate").style.display = 'none';
    [/code]
    I used this line in a Onclick JS Function

    Note - I used Firebug to check Div Id of the pagination buttons.

    Hv Fun Coding, Byee
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You could try the print view in TableTools as well: http://datatables.net/release-datatables/extras/TableTools/

    Allan
This discussion has been closed.