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. Printer Friendly Page with too big data to be passed

Printer Friendly Page with too big data to be passed

Scheduled Pinned Locked Moved Web Development
htmlalgorithmshelpquestion
5 Posts 4 Posters 1 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.
  • M Offline
    M Offline
    Mohammed Derbashi
    wrote on last edited by
    #1

    Hi all, I'm trying to develope a printer friendly page, the problem is that the content of the page is the search results of another one, and I'm triying pass this content to the print page without having to perform the searching proccess again, in other words ... how can I pass a huge amount of data between these two pages using Client-Side only. By the way this contant should be in HTML format. Mohammed Derbashi Web Developer

    N P 2 Replies Last reply
    0
    • M Mohammed Derbashi

      Hi all, I'm trying to develope a printer friendly page, the problem is that the content of the page is the search results of another one, and I'm triying pass this content to the print page without having to perform the searching proccess again, in other words ... how can I pass a huge amount of data between these two pages using Client-Side only. By the way this contant should be in HTML format. Mohammed Derbashi Web Developer

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      You can hide the values of the page in hidden tags:

      and then you can request through client side code the value function WriteMe() { document.write("You searched criteria was " + window.opener.document.test.search.value); } You might need to double check the Javascript, but it looks something like this. Otherwise just repost back to the server. :) Nick Parker


      1 Reply Last reply
      0
      • M Mohammed Derbashi

        Hi all, I'm trying to develope a printer friendly page, the problem is that the content of the page is the search results of another one, and I'm triying pass this content to the print page without having to perform the searching proccess again, in other words ... how can I pass a huge amount of data between these two pages using Client-Side only. By the way this contant should be in HTML format. Mohammed Derbashi Web Developer

        P Offline
        P Offline
        Paul Watson
        wrote on last edited by
        #3

        Mohammed Derbashi wrote: I'm trying to develope a printer friendly page <Paul puts on his Preacher hat> You should not be trying to develop a seperate page for printing, it is conceptually unsound. First off as you have pointed out it can lead to uneeded server load. This is how you do it. You create two CSS files, one for the screen media, and the other for the print media. In the print media CSS file you basically use the display:none attribute to hide all the elements on the page you do not want to print. You also specify how you want the elments you want to print to look. In this way you can totally re-style a page for printing (e.g. getting rid of navigation, upping the font size, putting in page-breaks etc.) without two seperate ASP/HTML files. Also it requires no round trip to the server. The browser handles it for you. To reference your two CSS files you do this: <link rel="stylesheet" href="res/css/printable.css" type="text/css" **media="print"** /> for the print stylesheet and <link rel="stylesheet" href="res/css/default.css" type="text/css" **media="screen"** /> As an added bonus you can specify both media="screen, print" to say the default.css file applies to both media. Then when printing any duplicate classes in the printable.css file will override the default.css classes. Now lets say you have an input element on your page that you do not want to be printed. You assign it a class like so <input type="text" **class="inputelement"** id="txtFirstName" /> and then in the printable.css file you create a new class like so input.**inputelement**{ display:none } Here is a good article on it. One great benefit of doing this is that should you make a change to the page it will show in the screen and print versions without you having to modify two seperate ASP files. So maintenance is greatly improved. If you have any problems, just ask :) </Paul puts on his Preacher hat>

        Paul Watson
        Bluegrass
        Cape To

        N 1 Reply Last reply
        0
        • P Paul Watson

          Mohammed Derbashi wrote: I'm trying to develope a printer friendly page <Paul puts on his Preacher hat> You should not be trying to develop a seperate page for printing, it is conceptually unsound. First off as you have pointed out it can lead to uneeded server load. This is how you do it. You create two CSS files, one for the screen media, and the other for the print media. In the print media CSS file you basically use the display:none attribute to hide all the elements on the page you do not want to print. You also specify how you want the elments you want to print to look. In this way you can totally re-style a page for printing (e.g. getting rid of navigation, upping the font size, putting in page-breaks etc.) without two seperate ASP/HTML files. Also it requires no round trip to the server. The browser handles it for you. To reference your two CSS files you do this: <link rel="stylesheet" href="res/css/printable.css" type="text/css" **media="print"** /> for the print stylesheet and <link rel="stylesheet" href="res/css/default.css" type="text/css" **media="screen"** /> As an added bonus you can specify both media="screen, print" to say the default.css file applies to both media. Then when printing any duplicate classes in the printable.css file will override the default.css classes. Now lets say you have an input element on your page that you do not want to be printed. You assign it a class like so <input type="text" **class="inputelement"** id="txtFirstName" /> and then in the printable.css file you create a new class like so input.**inputelement**{ display:none } Here is a good article on it. One great benefit of doing this is that should you make a change to the page it will show in the screen and print versions without you having to modify two seperate ASP files. So maintenance is greatly improved. If you have any problems, just ask :) </Paul puts on his Preacher hat>

          Paul Watson
          Bluegrass
          Cape To

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          What about cross brwoser support? I've found that display:none doesn't work in Netcrape.

          P 1 Reply Last reply
          0
          • N Not Active

            What about cross brwoser support? I've found that display:none doesn't work in Netcrape.

            P Offline
            P Offline
            Paul Watson
            wrote on last edited by
            #5

            Mark Nischalke wrote: What about cross brwoser support? I've found that display:none doesn't work in Netcrape It works in Netscape 6 and as of yesterday Netscape 4 should no longer be supported. So talking about cross browser it will work in IE5+, Opera 6+, Netscape 6+ and Mozilla 1+. Works on the Mac in those browsers too.

            Paul Watson
            Bluegrass
            Cape Town, South Africa

            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