View Single Post
  #1 (permalink)  
Old April 25th, 2006, 04:22 AM
NinaWilliam NinaWilliam is offline
Authorized User
 
Join Date: Mar 2006
Location: Doha, , Qatar.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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,t oolbar=0,scrollbars=0,status=0');
            WinPrint.document.write(prtContent.innerHTML);
            WinPrint.document.close();
            WinPrint.focus();
            WinPrint.print();
            show(true,'srcPnl');
            WinPrint.close();
            }




Happy Programming :)
__________________
Happy Programming :)