Hi, I have a project much like this you mention.  You can't create a Word
(.doc) file in Java, MS_Word does some compiling or whatever that makes it
possibly imposible to do in Java.  You can create RTF files.  OUr aproach
was to save RTF templates with some anchors (placeholders) in our server,
then make a copy of them and save them in another directory.  After this, we
replaced the placeholders with the actual data the user was working on and
sent it to them.  If you have access to Servlet Programming by J. Hunter he
has a great example on how tho send a file to a user, even if there is a
posibility of different Content Types; if you only want to create and save
the files on the server but don't need to see them immediately you don't
need this.

For display only purposes there is another possibility.  If you make your
screens as JSP's you can set the content type as application/msword.  You
can create your HTML as always, in the <HEAD> tag you could set it like
this:
<% response.setContentType("application/msword") %>

IE will change it's interface to a Word-like one, Netscape will actually
open Word.  BUT, you have to assume that all your users have the HTML
extensions to MS-Word installed.  If they don't all they will see is pretty
HTML code.  This was a no-no in our project, since we support sales reps on
the street that as you might know can sometimes be veeery dumb about
technical stuff, and the laptops or computers the company provides don't
have those extensions installed by default.

William J Ortiz
Information Analyst Associate
XGAF - Metered Supplies
e-mail: [EMAIL PROTECTED]


-----Original Message-----
From: Vikas Paliwal [mailto:[EMAIL PROTECTED]]
Sent: Saturday, October 14, 2000 1:25 AM
To: [EMAIL PROTECTED]
Subject: [SERVLET-INTEREST] Generation of word/rtf docs using Java


Hi all,

I have a requirement which needs the reports to be generated in MS WORD /
RTF
format...
Is it possible? If any body has done that. Please help.

Thanks in Advance...
Vikas

___________________________________________________________________________
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

Reply via email to