> the requirement is as such:
> i have a html page.i have an applet inside it which is grid.i select one
> row in the grid,and when i click 'print' button in the page the javascript
> function has to call a function in applet java file(to get the required
> data) and returns to javascript.Then a servlet file is called which fills
> all the above data into a preformatted report file.(report.rtf).
> Now the requirement is
> on click of button the word document should be opened at the same time it
> should get printed(without clicking the print option from file menu of
> doc).
> My Present Status is:
> i could open the doc as well get it printed .but the problem is it is
> printing the template as after filling the template it is not saved.how to
> save the file after getting filled in servelt file/javascript??
> the other problem is the template resides in server so the saved file
> should reside in the client machine.and after printing it should even
> delete the file in client machine.
> pls help me if u have any ideas
> note: i ma enclosing my servlet file.
> thanks in advance
> raghava
>
[Raghava Krishna (CTC)] package com.aig.claims.framework;
import java.rmi.*;
import java.util.*;
import javax.ejb.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.PrintWriter;
import com.aig.claims.framework.*;
public class ACEPrintServiceBean {
private ActionMap actionMap = null;
private ArrayList boDetails = null;
private BODetail boDetail = null;
private ActionDispatcherHelper adHelper = null;
/**
* ACESearchServiceBean constructor comment.
*/
public ACEPrintServiceBean() {
super();
}
/**
* ejbActivate method comment.
*/
public void ejbActivate() throws RemoteException {
}
/**
* ejbActivate method comment.
*/
public void ejbCreate() throws CreateException, RemoteException {
}
/**
* ejbPassivate method comment.
*/
public void ejbPassivate() throws RemoteException {
}
/**
* ejbRemove method comment.
*/
public void ejbRemove() throws RemoteException {
}
public void PrintDatainWord(HttpServletRequest req ,
HttpServletResponse response, String sArgs)
throws ActionError, RemoteException {
PrintWriter out;
try{
System.out.println("Wordss");
System.out.println("sArgs is "+ sArgs);
response.setContentType("application/msword");
StringTokenizer st2 = new StringTokenizer(sArgs,
"|");
int totaldata = st2.countTokens();
System.out.println("totaldata is "+ totaldata);
String str[] = new String[totaldata];
int i=0;
while(st2.hasMoreTokens())
{
str[i] =st2.nextToken();
str[i]=str[i].trim();
if(str[i].equals("SPACE"))
{
str[i]=" ";
}
i++;
}
for(i=0;i<str.length;i++)
{
System.out.println("str["+i+"]"+str[i]);
}
out = response.getWriter();
WordGenerator wg = new WordGenerator();
Hashtable ht = new Hashtable();
ht.put("Shell","");
ht.put("StatsOnly","");
ht.put("Date","");
ht.put("Logno","");
ht.put("Requester","");
ht.put("Telephone","");
ht.put("Fax","");
ht.put("Policy",str[5]);
ht.put("Insured",str[9]);
ht.put("Asco",str[7]);
ht.put("ISSCO",str[13]);
ht.put("DOL","");
ht.put("MJC",str[2]);
ht.put("DIVISION",str[14]);
ht.put("BeneSt","");
wg.tableValues = ht;
wg.fileName = "C:\\Report.rtf";
out.println(wg.FindBookmarks());
out.close();
} catch( Exception ex) {
System.out.println(ex.toString());}
catch(Throwable tt){new ActionError(1,"","","","");}
}
/**
* setSessionContext method comment.
*/
public void setSessionContext(SessionContext ctx) throws
RemoteException {
}
>
>
> -----Original Message-----
> From: Kurelli Rajshekar [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, June 10, 2002 4:18 PM
> To: [EMAIL PROTECTED]
> Subject: Re: printing a document on click of button
>
> Dear Raghava,
>
> its quick simple.
>
> on the button event just give the window.print() command.
>
> that should work. if you have probs lemme know
>
> Best regards,
> Raj
>
> -----Original Message-----
> From: Raghava Krishna (CTC) [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 10, 2002 3:05 PM
> To: [EMAIL PROTECTED]
> Subject: printing a document on click of button
>
>
> hi all
> i have a requirement:
> i want a document to be printed on click of a button in the web
> page.i.e.it
> should not open a word document.it should directly connect to
> printer
> and
> the document is to be printed.
> pls if anyone knows the logic or content present in any sites pls
> let me
> know
> thanks in advance
> raghava
>
>
> ________________________________________________________________________
> ___
> To unsubscribe, send email to [EMAIL PROTECTED] and include in
> the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives:
> http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
> http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
> __________________________________________________________________________
> _
> To unsubscribe, send email to [EMAIL PROTECTED] and include in
> the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives:
> http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
> http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html