printing functionality in jsp

hello sir,

          I have done project using jsp and oracle 9i. My
 client told that, for reports place a button with name
 print at the bottom of the page . Clicking on that button
 should display print dialog box and should perform
 printing functionality. I have used javascript's
 window.print method. but problem is, the bottom of
 printing page contailns address in location bar.
 I have to provide printing functionality without displaying the address at the bottom of the page.
 how i can provide this ?

         Please explain with necessary code.
         Thank you.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

basically, try :

document.print() ;

instead of

window.print() ;
>> I have to provide printing functionality without displaying the address at the bottom of the page.
document.print() won't do this for you either.
The answer to your question is NO, there is no way you can do this with simple html and javascript.
you'll need signed applet or activeX to layout the page yourself and then print, that will be windows programming, not web programming.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

bah ;-)

Still I learned something today :-)
ken, if that's the case, can not print using the javscript, then what can we do for printing solution for the web-based?

I heard lot of people talking this disadvantage of the web-based project. When in printing issues, always have a limitation..

what would you do (i mean easy approach for dummy like me) if you want to do printing? pdf? javascipt? or etc????
For sure there is no easy approach for fine controlled printing in web app. If user really need hight quality, fine grained printing control, I use PDF.

If the report is relatively small (less then 50 pages), I think xsl-fo + jakarta FOP is good enough.
ram1979, sorry to interrupt on the question.:-)

ken,what is the best advice you would suggest if i am using the approach like what you've mentioned above? PDF approach....

any URL or class file or API or sample program that you can refer to us??

i think ram1979 also having the same problem like i do. Whereby customer insist on printing something on the printing solutions.....

There a a lot of commercial PDF solution and web reporting solution out there. Personally, as I said above, I use apache FOP (sorry, did I said jakarta FOP? :) which is pretty good, it's based on xsl standard (xslt and xsl-fo), you'll need to learn xslt and xsl-fo in order to use it.

thank you.

I had similar problems in ASP.
As ken said that you would need signed applet or ActiveX control... one company has done just that.
Use their product ScriptX which will help you in controlling the client side printing through IE (limitation IE only).

You can find the resource here:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.