|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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="javascript rintThis();">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:
|
|
#3
|
||||
|
||||
|
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.
|
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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 |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Stopping certain page items from printing |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|