Hi Brother, Just for your info, I was trying for the samething last time and my requirement was to print from server side..Means that I have a fixed printer with ip address and I use Java print...This means When client click the print button ,it will come to server and server will directly print the page...So there is no user interaction once they click the print button..
But your requirement seems like u want to print from the webpage and there limited options like window.print() command in javascript..When u use this it will definetly prompt for u to choose the printer in ur client/browser PC....That's the safest way and It u try some active and hardcode the printer then u need to makesure that all ur browser pc has same printer name....If u find any other majic pls pls share with me also Hope This would help some way Many Thanks and Regards, Jerson -----Original Message----- From: Brian Thompson [mailto:elephant...@gmail.com] Sent: Monday, February 21, 2011 2:47 PM To: Struts Users Mailing List Cc: @rju Subject: Re: sending the report directly to the printer Try putting the window.print() in the code for the page at urlx. -Brian On Sun, Feb 20, 2011 at 11:39 PM, @rju <nagarjunabatt...@gmail.com> wrote: > > exactly i did > but the problem here is.. see my code > > var urlx="myaction.action"; > var x= window.open(urlx); > x.window.print(); > > here it is invoking printer > but empty page is printing because the action is taking time to load. > thats y am getting empty page so any alternative????? > > > Brian Thompson-5 wrote: > > > > Then no, there's no way to do this. > > > > What you *can* do is: > > > > User clicks HTML button --> Struts action/Jasper report displays --> some > > javascript on the report calls window.print(); --> user clicks "OK" on > the > > Print dialog. > > > > -Brian > > > > > > > > On Sun, Feb 20, 2011 at 10:27 PM, @rju <nagarjunabatt...@gmail.com> > wrote: > > > >> > >> yes user is clicking html/jsp button only > >> > >> Brian Thompson-5 wrote: > >> > > >> > Where is the user clicking "ok"? Do you mean an HTML button? Or the > >> > browser's print dialog box? > >> > > >> > At the very least, the user will see the print dialog...there's no way > >> > around that for a web page (which, ultimately, is what Struts is > >> sending > >> > to > >> > the user). > >> > > >> > -Brian > >> > > >> > > >> > > >> > On Sun, Feb 20, 2011 at 9:46 PM, @rju <nagarjunabatt...@gmail.com> > >> wrote: > >> > > >> >> > >> >> no sir. > >> >> no. user interaction means he will press ok button. > >> >> there "no user interaction" means after clicking "ok", some guys > >> >> suggested > >> >> me that use onLoad () then write one listener for print. so here no > >> user > >> >> interaction means after pressing ok button. > >> >> > >> >> user will interact only by pressing ok button. after that ok button > >> will > >> >> call the struts action. > >> >> so here now without any user interaction i need the print out after > >> >> calling > >> >> action unlike a report pdf. > >> >> hope u got my point > >> >> > >> >> > >> >> Dave Newton-6 wrote: > >> >> > > >> >> > I have no idea. Personally, I'd be a little surprised if it was > >> >> > possible to print from a website with *no* user interaction without > >> >> > using something like ActiveX, an applet, or *something*. > >> >> > > >> >> > Dave > >> >> > > >> >> > On Sun, Feb 20, 2011 at 11:06 AM, @rju <nagarjunabatt...@gmail.com > > > >> >> wrote: > >> >> >> > >> >> >> sir please help me > >> >> >> i ve already told my requirement as follows > >> >> >> am using struts2-jasper plugin am calling my action through > jquery. > >> >> >> nw i need to print the report directly from printer when i ve > >> pressed > >> >> ok > >> >> >> button. > >> >> >> ok button will call the action. > >> >> >> please help me ragarding this.Its very urgent for me and it is the > >> >> main > >> >> >> requirement for this project... > >> >> >> > >> >> >> > >> >> >> > >> >> >> Dave Newton-6 wrote: > >> >> >>> > >> >> >>> He's saying "Hit Ctrl-P from inside a PDF reader. > >> >> >>> > >> >> >>> On Wednesday, February 16, 2011, @rju < > nagarjunabatt...@gmail.com> > >> >> >>> wrote: > >> >> >>>> > >> >> >>>> if dont mind can you tell in detailed manner > >> >> >>>> -- > >> >> >>>> View this message in context: > >> >> >>>> > >> >> > >> > http://old.nabble.com/Integrate-JasperReports-into-a-Struts2-web-application-tp23479814p30946620.html > >> >> >>>> Sent from the Struts - User mailing list archive at Nabble.com. > >> >> >>>> > >> >> >>>> > >> >> >>>> > >> >> --------------------------------------------------------------------- > >> >> >>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> >> >>>> For additional commands, e-mail: user-h...@struts.apache.org > >> >> >>>> > >> >> >>>> > >> >> >>> > >> >> >>> > >> --------------------------------------------------------------------- > >> >> >>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> >> >>> For additional commands, e-mail: user-h...@struts.apache.org > >> >> >>> > >> >> >>> > >> >> >>> > >> >> >> > >> >> >> -- > >> >> >> View this message in context: > >> >> >> > >> >> > >> > http://old.nabble.com/Integrate-JasperReports-into-a-Struts2-web-application-tp23479814p30971331.html > >> >> >> Sent from the Struts - User mailing list archive at Nabble.com. > >> >> >> > >> >> >> > >> >> >> > >> --------------------------------------------------------------------- > >> >> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> >> >> For additional commands, e-mail: user-h...@struts.apache.org > >> >> >> > >> >> >> > >> >> > > >> >> > > >> --------------------------------------------------------------------- > >> >> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> >> > For additional commands, e-mail: user-h...@struts.apache.org > >> >> > > >> >> > > >> >> > > >> >> > >> >> -- > >> >> View this message in context: > >> >> > >> > http://old.nabble.com/Integrate-JasperReports-into-a-Struts2-web-application-tp23479814p30974347.html > >> >> Sent from the Struts - User mailing list archive at Nabble.com. > >> >> > >> >> > >> >> --------------------------------------------------------------------- > >> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> >> For additional commands, e-mail: user-h...@struts.apache.org > >> >> > >> >> > >> > > >> > > >> > >> -- > >> View this message in context: > >> > http://old.nabble.com/Integrate-JasperReports-into-a-Struts2-web-application-tp23479814p30974450.html > >> Sent from the Struts - User mailing list archive at Nabble.com. > >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> For additional commands, e-mail: user-h...@struts.apache.org > >> > >> > > > > > > -- > View this message in context: > http://old.nabble.com/Integrate-JasperReports-into-a-Struts2-web-application-tp23479814p30974618.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org