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, 10: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: 7
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, 05: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: 8
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, 05: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: 8
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, 10: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, 12: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





 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

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





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 12 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek