469,645 Members | 1,184 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

Any special considerations for making printable version of page?

I'm going to use an aspx page to display an invoice that customers can print
from. Sometimes when I go to a site and navigate to a page I want to print,
they will have a button that says something like "Show Printable Version".
Other than taking out all of the gui stuff and making a simple clean page
for printing, is there any other design considerations for making a page
good for printing? I'm using frames and all of my content shows in the main
frame. Is it possible to have the invoice aspx page show in the main frame
and then just print that page and not the header and left menu frame?

Thanks.

--
mo*******@nospam.com
Nov 18 '05 #1
1 1714
Hi Moondaddy,

From your description, you want to implement the printable page function
which can help print a specify "printable" page. Also, your web application
is frame based, so your problem is mainly focus on how to specify a certain
frame to be printed, yes?

As for this problem, I think you can use the following means:
1. When in frame based page, we can use window.parent.frames("framename")
to reference a certain frame we want. Then if we want a specified frame to
be printed when we call "window.print()", we can use the "focus()" function
of a window. For example, we have a three frames structure page.
-----------------------------------------------
top
-----------------------------------------------
left | right
|
|
---------------------------------------------------

if we want to print the right frame when a button in left frame(in fact
this applies no matter in which frame the function id called) is clicked:

<script language="javascript">
function printFrame(frm)
{
window.parent.frames(frm).focus();
window.print();
}
</script>

<input type="button" onclick="printFrame('right')" />

#Notice that the key point is call the .focus() method which set the
active frame(which will be printed when window.print() is called no matter
in which frame).

2. Also, I think you can also use the window.open( url of the printable
page) or a hyperlink such as
<a href="url of the printable page" target="_blank" />
to open a new browser window which will contain the printable page. Do you
think so?
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx


Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by CJM | last post: by
2 posts views Thread by Harold R | last post: by
7 posts views Thread by Sens Fan Happy In OH | last post: by
10 posts views Thread by CJM | last post: by
8 posts views Thread by abhi147 | last post: by
3 posts views Thread by Arancaytar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.