Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. HOw can i add Header and footer?

HOw can i add Header and footer?

Scheduled Pinned Locked Moved ASP.NET
questionjavascript
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NinaWilliam
    wrote on last edited by
    #1

    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(); }

    R 1 Reply Last reply
    0
    • N NinaWilliam

      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(); }

      R Offline
      R Offline
      Richard Parsons
      wrote on last edited by
      #2

      Not sure this is what you are going for but if you can do this: WinPrint.document.write(prtContent.innerHTML); why not do something like this: WinPrint.document.write(YourHeaderHTML); WinPrint.document.write(prtContent.innerHTML); WinPrint.document.write(YourFooterHTML); -Richard

      N 1 Reply Last reply
      0
      • R Richard Parsons

        Not sure this is what you are going for but if you can do this: WinPrint.document.write(prtContent.innerHTML); why not do something like this: WinPrint.document.write(YourHeaderHTML); WinPrint.document.write(prtContent.innerHTML); WinPrint.document.write(YourFooterHTML); -Richard

        N Offline
        N Offline
        NinaWilliam
        wrote on last edited by
        #3

        Thanks you Richard very much.. I will try it :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups