473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Printing only part of the page without opening new window?

Hi,

I want to send a table that exist in my page to the printer, without opening
a new window.

Is it possible?
If it is not possible to do this in javascript, can I do it with JSP?

Thanks,
Alon
Jul 23 '05 #1
2 6536
To do this you need to isolate the table to be printed. There are three
ways to do this:

1. Wrap all other content on the page in div tags with a style that won't
display on print media

<style media="print">
.noPrint {
display: none;
}
</style>
<div class=noprint>
content...
</div>
<table>
stuff to print...
</table>

This would of course mean that the table would be the only thing to print.

2. Write a javascript routine that upon clicking the button on the page
loops through all the divs on your page and sets their class to "noPrint",
calls print, then resets the classes.

3. (by far the simplest way) Open a new window with just the table in it,
and close it immediately after printing.

There are plenty of resources on the net for each of these methods, some of
which are browser specific.
--
William Morris
Semster, Seamlyne reProductions
Visit our website, http://www.seamlyne.com, for the most comfortable
historically inspired clothing you can buy!


"Alon" <no****@hotmail.com> wrote in message
news:1082031867.186373@sointsocks...
Hi,

I want to send a table that exist in my page to the printer, without opening a new window.

Is it possible?
If it is not possible to do this in javascript, can I do it with JSP?

Thanks,
Alon

Jul 23 '05 #2

"Alon" <no****@hotmail.com> wrote in message
news:1082031867.186373@sointsocks...
Hi,

I want to send a table that exist in my page to the printer, without opening a new window.

Is it possible?
If it is not possible to do this in javascript, can I do it with JSP?

Thanks,
Alon

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: vishal | last post by:
hi i am creating one site and i am not allowed to use client side scripting in site and i have one link in my one page. when user clicks on this link the target page must be opened in another...
5
by: Donnal Walter | last post by:
We want to be able to print HTML or PDF files to a given printer from Python in a kind of batch mode (without opening a preview window or printer dialog for each file). The printer is on a network,...
6
by: John Smith | last post by:
How to print when the user clicks a button in ASP.Net application. Is it possible to call print dialog so that the user can printer properties before printing? My development environment is .Net...
9
by: tshad | last post by:
This is from my previous post, but a different issue. I have the following Javascript routine that opens a popup page, but doesn't seem to work if called from an asp.net button. It seems to work...
5
by: Tom | last post by:
I am converting an old application that was printing directly to a specialized printer device (i.e. a special label printer). It was doing this by opening a file with the file path of 'LPT1:' and...
5
by: Micah | last post by:
I'm in the middle of a project using ASP pages that access an Access database. I'd like to know how I can print a page without IE putting the Page X of X at the top and the address/ date at the...
1
Frinavale
by: Frinavale | last post by:
Hi there, I'm currently attempting to print a web-page at the end of a lengthy registration process. The script I'm using is quite simple: <body onload="window.print(); window.close();"> ...
7
kvijayhari
by: kvijayhari | last post by:
hi i've doubt in the window.print() function. I'm using a css with the attribute media=print and i'm hiding the unwanted things from display for printing using this css. I'm opening a window...
18
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.