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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Printing a grid

Printing a grid

Scheduled Pinned Locked Moved ASP.NET
javascriptjavacsstools
5 Posts 3 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.
  • S Offline
    S Offline
    samerh
    wrote on last edited by
    #1

    Hi all iam printing a grid view by using the following java script. I want to use paging however this JS is only printing the first page. Any ideas on how can print all and use paging. <script type="text/javascript"> function PrintReport() { var m = document.getElementById('menu'); m.style.display='none'; window.print(); m.style.display='block'; } </script>

    N 1 Reply Last reply
    0
    • S samerh

      Hi all iam printing a grid view by using the following java script. I want to use paging however this JS is only printing the first page. Any ideas on how can print all and use paging. <script type="text/javascript"> function PrintReport() { var m = document.getElementById('menu'); m.style.display='none'; window.print(); m.style.display='block'; } </script>

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      samerh wrote:

      window.print();

      This is not printing the Gridview alone. it's printing the whole page. It will print whole contents of page. So if your grid view is showing only first page, you will get only that in print out. To get a complete print, you should show all data on the page.

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

      S 1 Reply Last reply
      0
      • N N a v a n e e t h

        samerh wrote:

        window.print();

        This is not printing the Gridview alone. it's printing the whole page. It will print whole contents of page. So if your grid view is showing only first page, you will get only that in print out. To get a complete print, you should show all data on the page.

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        S Offline
        S Offline
        samerh
        wrote on last edited by
        #3

        Isn't there another way to print only the grid?

        N 1 Reply Last reply
        0
        • S samerh

          Isn't there another way to print only the grid?

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          Copy grid to a blank page and print from there

          All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

          S 1 Reply Last reply
          0
          • N N a v a n e e t h

            Copy grid to a blank page and print from there

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

            S Offline
            S Offline
            Sutheesh
            wrote on last edited by
            #5

            s

            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