print scrollable div

D

Dan

Hi,

This may be the wrong place to ask this question, but here goes
anyway. I have a RIA that I developed so that there is a scrollable
div in the bottom right portion of the screen that always stays
there. The only problem with this is that now the client is
complaining that he cant print the content in this div properly. ie.
Firefox prints just what you see on the page. How can I go about
changing what Firefox prints (without changing the layout of the RIA
of course) so that just the content of the div is printed (all of the
content - even if you cant see it all)?

Any help would be appreciated!

Thanks,
Daniel
 
M

Martin Honnen

Dan said:
This may be the wrong place to ask this question, but here goes
anyway. I have a RIA that I developed so that there is a scrollable
div in the bottom right portion of the screen that always stays
there. The only problem with this is that now the client is
complaining that he cant print the content in this div properly. ie.
Firefox prints just what you see on the page. How can I go about
changing what Firefox prints (without changing the layout of the RIA
of course) so that just the content of the div is printed (all of the
content - even if you cant see it all)?

Try to supply a CSS stylesheet for media="print" that defines the layout
you want your document to be printed with. That way you can define a
different layout just for printing, without changing the screen layout.
 
D

Dan

Try to supply a CSS stylesheet for media="print" that defines the layout
you want your document to be printed with. That way you can define a
different layout just for printing, without changing the screen layout.

I have tried to accomplish this without much success. I can force
Firefox to only print the one div when printing (by setting every
other div to display:none;) but still cannot get it to print
everything in the div (it only prints what you see on the screen).
Also using this method, Firefox will not move the div to the normal
spot on the page when printing (if for example, the content in the div
was on the page by itself). I was wondering if there was just some
simple way to tell a browser to print only the content found in a
specified div instead of trying to play around with a whole new style
sheet for printing...
 
M

Martin Honnen

Dan said:
I have tried to accomplish this without much success. I can force
Firefox to only print the one div when printing (by setting every
other div to display:none;) but still cannot get it to print
everything in the div (it only prints what you see on the screen).

This is a CSS problem, not a JavaScript problem. You might want to make
sure the print stylesheet does not make the div scrollable. Ask in
comp.infosystems.www.authoring.stylesheets if you still have problems.
Or if the problem is Firefox specific then choose a newsgroup on
news.mozilla.org.
Also using this method, Firefox will not move the div to the normal
spot on the page when printing (if for example, the content in the div
was on the page by itself). I was wondering if there was just some
simple way to tell a browser to print only the content found in a
specified div instead of trying to play around with a whole new style
sheet for printing...

IE has events onbeforeprint and onafterprint but whether you specify a
different layout for printing using CSS or using script and those events
should not matter. With both approaches you need to set display to none
for those sections you do not want to be printed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top