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. Call window.print() inside loop

Call window.print() inside loop

Scheduled Pinned Locked Moved ASP.NET
4 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.
  • P Offline
    P Offline
    Praveen Kandari
    wrote on last edited by
    #1

    Hi All, I want to print my .aspx page with data while its running inside a loop. For E.g My loop is till dt.rows.count and in every loop I Want to print the page with data. If count is 7 than 7 pages need to be printed.

    Z F 2 Replies Last reply
    0
    • P Praveen Kandari

      Hi All, I want to print my .aspx page with data while its running inside a loop. For E.g My loop is till dt.rows.count and in every loop I Want to print the page with data. If count is 7 than 7 pages need to be printed.

      Z Offline
      Z Offline
      ZurdoDev
      wrote on last edited by
      #2

      What is your question?

      There are only 10 types of people in the world, those who understand binary and those who don't.

      1 Reply Last reply
      0
      • P Praveen Kandari

        Hi All, I want to print my .aspx page with data while its running inside a loop. For E.g My loop is till dt.rows.count and in every loop I Want to print the page with data. If count is 7 than 7 pages need to be printed.

        F Offline
        F Offline
        F ES Sitecore
        wrote on last edited by
        #3

        This is more a CSS issue. You can't print to the client's machine via asp.net code, and your asp.net code runs in its entirety before sending anything to the client so you can't "loop" the way you are intending. Instead send all 7 pages to the client with the relevant css that designates where the page breaks are and the client will need to print from their browser (no you can't do that automatically either, neither can you force them to print) and the documents will be on their own pages. Google for css page breaks or for print style css in general.

        P 1 Reply Last reply
        0
        • F F ES Sitecore

          This is more a CSS issue. You can't print to the client's machine via asp.net code, and your asp.net code runs in its entirety before sending anything to the client so you can't "loop" the way you are intending. Instead send all 7 pages to the client with the relevant css that designates where the page breaks are and the client will need to print from their browser (no you can't do that automatically either, neither can you force them to print) and the documents will be on their own pages. Google for css page breaks or for print style css in general.

          P Offline
          P Offline
          Praveen Kandari
          wrote on last edited by
          #4

          Thanks for your reply.. I have found the solution using jquery function window.open inside loop..

          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