 |
|
|
02-08-2001, 04:21 AM
|
|
#1
|
 |
|
Novice (Level 1)
Join Date: Feb 2001
Posts: 4
|
I am working on a project in which I can not use any component. And I have to send a HTML report to the browser which can easily be printed at the client end. The report needs to have a page header & footer on every page.
PROBLEM: How to get the client's page settings, set in the browser, Or how to override the browser page settings so that the formatting done at the server end should not be spoiled. I am using ASP at the server end. The solution should be compatible with IE4.0 and NN4.0 .
PLEASE. HELP!!!!!!!!!!!!
|
|
Add to del.icio.us
Can you digg it?
|
|
|
02-08-2001, 09:17 PM
|
|
#2
|
 |
|
Super Virtual Guru
Join Date: Jan 2001
Location: Colorado, USA
Posts: 5,573
|
without getting too complicated...this will work
<A HREF="javascript:window.print()">Click to Print This Page</A>
|
|
Add to del.icio.us
Can you digg it?
|
|
|
02-09-2001, 12:47 AM
|
|
#3
|
 |
|
Novice (Level 1)
Join Date: Feb 2001
Posts: 4
|
Thank you Dr. Web but I think I didn' get the answer.
My problem is how to get the page layout & margin at the client's end using JavaScript. Or What I need is "Scripting Support for Web Page Printing?" that should work for both IE4.0 & NN4.0 without using any components.
When I invoke "window.print()" The printed page has "Header's & Footer's" defined in the browser Print setup printed on the page (like, URL, date, Page number) which I don't want to be printed. Also I would like to know the default Page settings of the browser so that I should format my report according (at the server end) and when the user click on "window.print()" the printed page should not be clipped or divided into two pages at the client end which I have formated for a single page.
PLEASE ADVICE!!!!!!!!!!!!
|
|
Add to del.icio.us
Can you digg it?
|
|
|
02-09-2001, 04:07 AM
|
|
#4
|
 |
|
Sheriff (Almighty)
Join Date: Nov 1999
Location: Chch New Zealand God Mode: On
Posts: 3,167
|
Hi, check out a great article on 123webmaster about printing pages from the net http://www.123webmaster.com/Articles/cssprint.html
it uses css to specify what you want to print on your page, well worth the look !! If this is not what you mean, please let us know. thanks.
__________________
 Ian
|
|
Add to del.icio.us
Can you digg it?
|
|
|
02-09-2001, 05:05 AM
|
|
#5
|
 |
|
Novice (Level 1)
Join Date: Feb 2001
Posts: 4
|
Thank you Ian. But I am sorry to say that the problem still lies there.
FIRST and the formeost important thing is that I want a solution which should be compatible with both IE4.0 & NN4.0 .
Secondly, I need to print an HTML page which is formatted using <TABLE> tag through a web browser. When the page is printed every page should have a common Header.
Going through the Microsoft documentation I found that <THEAD> tag is actually meant for this functionality. This Tag is introduced in HTML 4.0 by W3C. But microsoft claims this as a bug in IE.
You can find the information regarding this BUg at microsoft. Just search for "BUG: THEAD and TFOOTER Text Is Not Printed on Each Page" or Search for "ID: Q190278" MoreOver Netscape does not support this too.
Thirdly, about using CSS. The new CSS 2 specification says that you can use @page to deine a page box. Define the page margins and page breaks with "page-break" etc. But again this new CSS specification is only supported by IE5 & above. Lot of sites are using this CSS2 spec to define a page break. Although microsoft does not still provide page margins and page orientation styles as proposed by CSS 2 specification in it's IE5.5
The "window.print()" is also not supported in IE4.x . Microsoft has given this support in IE5.0 & above although NN4.0 has it.
I think I must have made my point clear what I really want.
I REALLY NEED HELP!!!!!!!!!!!! PLEASE.........
|
|
Add to del.icio.us
Can you digg it?
|
|
|
02-09-2001, 09:19 AM
|
|
#6
|
 |
|
Sheriff (Almighty)
Join Date: Nov 1999
Location: Chch New Zealand God Mode: On
Posts: 3,167
|
Sorry that was of no help to you. Ever thought some things just can't be done ?? maybe you need to go client side for this and use a .cgi or vb application.
__________________
 Ian
|
|
Add to del.icio.us
Can you digg it?
|
|
|
02-14-2001, 04:06 AM
|
|
#8
|
 |
|
Hero (Level 10)
Join Date: Jan 2001
Location: Soest, Utrecht, the Netherlands
Posts: 92
|
This might not solve everything that you want (you might want the impossible), but this one works with NN...
<script language="JavaScript">
<!--
function custom_print() {
if (document.all) {
if (navigator.appVersion.indexOf("5.0") == -1) {
var OLECMDID_PRINT = 6;
var OLECMDEXECOPT_DONTPROMPTUSER = 2;
var OLECMDEXECOPT_PROMPTUSER = 1;
var WebBrowser = "<OBJECT ID=\"WebBrowser1\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>";
document.body.insertAdjacentHTML("beforeEnd", WebBrowser);
WebBrowser1.ExecWB(6, 2);
WebBrowser1.outerHTML = "";
} else {
self.print();
}
} else {
self.print();
}
}
//-->
</script>
greets,
Syst3m Err0r
|
|
Add to del.icio.us
Can you digg it?
|
|
|
02-16-2001, 07:10 AM
|
|
#9
|
 |
|
Novice (Level 1)
Join Date: Feb 2001
Location: rome
Posts: 1
|
hi,
i have a problem: i have a frameset and i put the JS to print in frame 1. is it possibile to print the frame 2 when the button is in the first frame?
thank you 
|
|
Add to del.icio.us
Can you digg it?
|
|
|
02-16-2001, 10:45 AM
|
|
#10
|
 |
|
Hero (Level 10)
Join Date: Jan 2001
Location: Soest, Utrecht, the Netherlands
Posts: 92
|
Thats up to the users browser/printer configuration.
Under IE you can set in the advanced options menu under [tools] > [ Preferences] things like 'print background images/colors' and at when pressed on the link, you'll get a printer options menu where you can choose weather you want to print one frame or al frames (ind. or like layout) but that's all up to the visitor. (It's exactly the same as [file] > [Print] or when you pudh on the printer icon.)
greetz,
Syst3m Err0r
[Edited by Syst3m Err0r on 02-16-2001 at 11:50 AM]
|
|
Add to del.icio.us
Can you digg it?
|
|
|
02-16-2001, 01:54 PM
|
|
#11
|
 |
|
1.21 Gigawatts
Join Date: Nov 1999
Location: Hill Valley
Posts: 4,812
|
Quote:
Originally posted by Ian
...maybe you need to go client side for this and use a .cgi or vb application.
|
Hey Ian, did you mean to say server side for this?
|
|
Add to del.icio.us
Can you digg it?
|
|
|
02-16-2001, 02:22 PM
|
|
#12
|
 |
|
Sheriff (Almighty)
Join Date: Nov 1999
Location: Chch New Zealand God Mode: On
Posts: 3,167
|
yip, made a boo boo, must have been one of those late night replys, sure you know what I'm taking about.  Sorry.
__________________
 Ian
|
|
Add to del.icio.us
Can you digg it?
|
|
|
10-31-2001, 06:13 AM
|
|
#14
|
 |
|
Novice (Level 1)
Join Date: Oct 2001
Location: INDIA
Posts: 1
|
add header or remove the option
hi there,
even i have the same problem,pls guide me if u know any alternative or way to solve this.it would be greatful.
thanx in advance
Krishna
|
|
Add to del.icio.us
Can you digg it?
|
|
|
10-31-2001, 06:35 PM
|
|
#15
|
 |
|
Super Guru (Moderator)
Join Date: Jul 2001
Location: Sydney, Australia
Posts: 1,852
|
There are some things that just can't be done - and this is one of them. Printing support is minimal in IE4 and NN4 - IE4 doesn't even have a print() method (although you can emulate it). What you can't do, however, is take charge of the user's printer and change margins, heading & footers, or print without their knowledge. This is to stop retail stores printing their entire catalog out on your printer when you navigate to their site, or putting an advertisement in your header.
If this is for an intranet, you could look at http://msdn.microsoft.com/library/de...l/wb_print.asp for some hints.
Also, see http://msdn.microsoft.com/library/de...dhtmlprint.asp as well.
If you can limit your audience to IE5.5+, you can use print templates. See http://www.webreference.com/js/column89/ for a tutorial.
To print another frame, do
<input type='button' onclick='parent.frames.OTHER_FRAME_NAME.print()'>
It won't achieve much though, as the user will still be prompted for which frame they want to print.
__________________
Jon Hanlon
|
|
Add to del.icio.us
Can you digg it?
|
|
 |
|
|
KEEP TABS |
|
SPONSORS |
| |

|
| |
|
|
| |
|