Results 1 to 4 of 4

Thread: HOw can i add Header and footer?

  1. #1

    Thread Starter
    Addicted Member NinaWilliam's Avatar
    Join Date
    May 2005
    Location
    @Home
    Posts
    133

    HOw can i add Header and footer?

    HOw can i add Header and footer?

    Hi i am using javascript code to print a datagrid in my page..is there a way to add header and footer in the document like a title on the header and page number in the footer?

    this is the function am calling t print:


    // quick browser tests
    var ns4 = (document.layers) ? true : false;
    var ie4 = (document.all && !document.getElementById) ? true : false;
    var ie5 = (document.all && document.getElementById) ? true : false;
    var ns6 = (!document.all && document.getElementById) ? true : false;

    function show(sw,obj) {
    // show/hide the divisions
    if (sw && (ie4 || ie5) ) document.all[obj].style.visibility = 'visible';
    if (!sw && (ie4 || ie5) ) document.all[obj].style.visibility = 'hidden';
    if (sw && ns4) document.layers[obj].visibility = 'visible';
    if (!sw && ns4) document.layers[obj].visibility = 'hidden';
    }
    // End -->

    //Print datagrid only function (print button 1)
    function CallPrint(strid)
    {
    show(false,'srcPnl');
    var prtContent = document.getElementById(strid);
    var WinPrint =
    window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
    WinPrint.document.write(prtContent.innerHTML);
    WinPrint.document.close();
    WinPrint.focus();
    WinPrint.print();
    show(true,'srcPnl');
    WinPrint.close();
    }
    Happy Programming

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    Re: HOw can i add Header and footer?

    Before the call:

    WinPrint.document.write(prtContent.innerHTML);

    Do

    WinPrint.document.write('My header');

    and do one for the footer too

  3. #3

    Thread Starter
    Addicted Member NinaWilliam's Avatar
    Join Date
    May 2005
    Location
    @Home
    Posts
    133

    Re: HOw can i add Header and footer?

    Hi mendhak.. long time no see
    thanks i will try it
    Happy Programming

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    Re: HOw can i add Header and footer?

    Happy Programming

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width