If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Print a different webpage to the one been viewed

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-03-04, 04:06
plsh plsh is offline
Registered User
 
Join Date: Nov 2004
Posts: 253
Print a different webpage to the one been viewed

Good day,

I would like to know if anyone knows how to send a different page to the printer when one wants to print a page. I can create a printer friendly page and open that when the users wants to print and then they can print that but I would prefer just to have a button or something and when they click it, it will print a formatted page. I current;y have a directory listing of people in our company with names, email addresses, contact numbers speed dials and so on and only want to print the persons name and speed dial, the rest I am not interested in. As I said, I can create a page that will open and that needs to be printed but it is not ideal as, well users are idiots for the most part, and will mess something up.

Any help or ideas woul dbe greatly appreciated.

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 12-05-04, 16:56
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
I've never tried this, so I can't vouch for it, but you could try to create an IFrame, set it to height and width = 0 (to hide it), then load the page to be printed into the IFrame and use JavaScript's window.print() on that page in the IFrame to print it out.. a shot in the dark, but worth a try.
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
  #3 (permalink)  
Old 12-06-04, 20:12
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
I was curious about this after I posted this, so I tried it out, and it does in fact work. You just have to remember that the window.print() call MUST come from the page loaded into the iframe.
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On