HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 4th, 2004, 11:48 AM
stevie17 stevie17 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 59 stevie17 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Stopping certain page items from printing

Does anyone know how to set items on my page to not print. For example of a page which displays a report I would like a piece of text linking to another page and an image not to print out.
E.g
Page.asp

Title Graphic
TABLE OF RESULTS
...............................................
...............................................
...............................................
Author
Date
<link>Return to Main Reporting Page<link>

How do I set it so as the graphic and bottom link aren't printed off when I print the report

Reply With Quote
  #2  
Old March 4th, 2004, 06:06 PM
dcarva's Avatar
dcarva dcarva is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 633 dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 18 m 20 sec
Reputation Power: 6
I recently had to do this with an HTML page. Not sure if this is the best way to do this since it won't work with old browsers, but...

There is a print link on my page. The href looks like this:

<a href="javascriptrintThis();">Print</a>

The function more or less does this:

function()
{
hidecertaintables();
window.print();
}

The hidecertain tables function would literally hide certain tables temporarily. It would change the display style in a div wrapped around a table...

<div id="test1" style="display:inline">
<table>...table stuff...</table>
</div>

The code is something like this:

function hidecertaintables()
{
document.all.test1.style.display == 'none';
}

At this point, the table disappears. The to set it back:

function showtables()
{
document.all.test1.style.display == 'inline';
// or loop through all elements and show all tables
}

Then you show the tables again. I hope this helps. It was only way I could figure out how to do it. If there is a better way, someone please speak up!

Quote:
Originally Posted by stevie17
Does anyone know how to set items on my page to not print. For example of a page which displays a report I would like a piece of text linking to another page and an image not to print out.
E.g
Page.asp

Title Graphic
TABLE OF RESULTS
...............................................
...............................................
...............................................
Author
Date
<link>Return to Main Reporting Page<link>

How do I set it so as the graphic and bottom link aren't printed off when I print the report

Reply With Quote
  #3  
Old March 4th, 2004, 06:10 PM
dcarva's Avatar
dcarva dcarva is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 633 dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 18 m 20 sec
Reputation Power: 6
Now that I think about it, even though it works, my example might be too much work for what you want. I would wait and see if anyone else replies.

Reply With Quote
  #4  
Old August 4th, 2004, 11:34 AM
djj djj is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 4 djj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
try css

How about using a style sheet, I'm not sure if you're using these anyway if you are this is another to use for printing.
Put this in the <head> of your doc <link href="someStyleSheet.css" rel="stylesheet" type="text/css" media="print">
it's the media="print" thats the important part.if you want not to print a graphic in the <img> tag place class="noPrint" and in the style sheet put
.noPrint {
display: none;
}
and do the same for anything else you don't want to print

Reply With Quote
  #5  
Old November 15th, 2004, 01:41 PM
tgimages tgimages is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 1 tgimages User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Eliminating IE's stuff

http://www.meadroid.com/scriptx/sxdownload.asp

I was trying to get the URL, date, etc. not to print. No way to do it from with ASP, but the above link is to an app I found that will do this. Took me 2 minutes to downlaod and implement. Very easy. Free for basic usage too. (and no, I have no affiliation to them).

-G

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Stopping certain page items from printing


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT