Link to home
Start Free TrialLog in
Avatar of Aleks
AleksFlag 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'  ?
Avatar of Big Monty
Big Monty
Flag of United States of America image

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...
Avatar of 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
Avatar of Big Monty
Big Monty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 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  :#
Avatar of Aleks

ASKER

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