Solved

printing functionality in jsp

Posted on 2003-12-02
12
369 Views
Last Modified: 2010-04-01
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.
0
Comment
Question by:ram1979
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
  • +1
12 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 9857817
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9857820
basically, try :

document.print() ;

instead of

window.print() ;
0
 
LVL 14

Accepted Solution

by:
kennethxu earned 63 total points
ID: 9860688
>> 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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Expert Comment

by:TimYates
ID: 9865073
bah ;-)

Still I learned something today :-)
0
 

Expert Comment

by:fks2
ID: 9873709
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????
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9875130
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.
0
 

Expert Comment

by:fks2
ID: 9887158
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.....

:-)
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9888645
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.

http://xml.apache.org/fop/


0
 

Expert Comment

by:fks2
ID: 9894228
thank you.

0
 
LVL 2

Assisted Solution

by:glottis
glottis earned 62 total points
ID: 9902328
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:
http://www.meadroid.com/scriptx/index.asp
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Lamba in java 8 9 260
maven project in eclipse 11 62
javax.naming.NameNotFoundException: Name ... is not bound in this Context. 6 403
countXY challenge 28 179
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
An introduction to the wonderful sport of Scam Baiting.  Learn how to help fight scammers by beating them at their own game. This great pass time helps the world, while providing an endless source of entertainment. Enjoy!
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question