Avatar of Aleks
Aleks
Flag for United States of America asked on

Print an element of the screen

I currently have code to print the entire screen of a report, but it includes nav bar and buttons that the end user doesn't want. what they want printed is the table.

The table has an ID, it is :

<table width="100%"  class="tablesample" id="results">


<a href="#" onClick="window.print();return false" title="Print"><img src="../../../Images/prints.gif" width="25" height="20" alt=""/></a>

How can I modify the code about so that it only prints the object with id = 'results'  ?
ASPWeb DevelopmentHTML

Avatar of undefined
Last Comment
Aleks

8/22/2022 - Mon
Big Monty

have a look at this question

https://www.experts-exchange.com/questions/28635559/Add-logo-when-printing-from-browser.html

you'll need to add a "print" css stylesheet that you will set which objects on your page you want to print.

you're other option is to redirect the user to a printer friendly page, which is a page that only has what you want printed on it.

I would go with the first option if it was me...
Aleks

ASKER
Ummm .. ok I guess. Thought there would be an easier way to do by simply printing a specific object instead of blocking those which I don't want
ASKER CERTIFIED SOLUTION
Big Monty

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Aleks

ASKER
I know .. what I meant was I thought there could be a parameter passed to the 'print' action so it would print that one element and not ALL which is what it does by default.
I have a DW extension that does this but prints to PDF or Excel, not to printer  :#
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Aleks

ASKER
Actually they do have an extension for that ... what do you know ... thanks for the help tho.
Aleks

ASKER