Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Frames 1

Status
Not open for further replies.

balachandar

Programmer
Apr 16, 2001
88
0
0
CA
Hi all,
I am using two frames in an ASP page. In the first page I have two buttons print,close. In the second frame I have data in a table.
When the print button is clicked the data has to be printed.I tried using Window.frames(0).print in the click event.I also tried window.frames(1).print. Both cause the top frmae to be printed.(Frmae having buttons). I also tried using the names of the frames in the above statement. Still I got the wrong frame getting printed. Can any one explain what needs to be done to fix this.
The requirement is when print button is clicked data on the page has to be printed but the buttons should not appear in the report. That is the reason why two frames were used.
Regards
Balachandar
 
document.top.frames[1].print();

might work for you.

document.top gets you to your frameset, and then you just print the second frame (or [1], as it is referred to).

penny.gif
penny.gif
 
If you don't want the buttons to appear on the print job, you could keep everything on one page (no frames) and use DHTML to hide the buttons before the print and restore them after.

...
buttons.style.display = 'none';
window.print;
buttons.style.display = '';
...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top