Chris:

Here is my actual problem...

I have a servlet that accepts some input criteria (e.g. department name),
execute a query in the database and print the result in tabular format.

Now we want the ability to save the table in excel format. There are few
ways to do this. One approach is to save the file in the server side (i.e.
after executing the query, generate the excel file and store them in the
server. When the user request to save the table as excel, download the file
from server) and provide an URL for the same. The issue is we generate too
many such files, so there are disk space issues associated with it. Not to
mention the overhead of maintaining additional purge process etc.

To avoid this, our approach is, instead of generating the table in the html
directly, generate a javascript function that will return the html and call
document.write whereever we want to show the table. In this way, if the user
want to save the file, they don't have to go to backend. They would rather
execute the javascript function and store the return value of the function
in to the file.

Now that I put the question in Servlet words... I hope to hear something
from people who can help me out there. This not only helps me, but probably
hundreds of people who joined this forum.

Note:

A servlet by itself is doing nothing but generating HTML.

Thanks
Balaji


-----Original Message-----
From: Christopher K. St. John [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 27, 2001 11:59 AM
To: [EMAIL PROTECTED]
Subject: Re: Saving into File


"Krishnamurthy, Balaji" wrote:
>
> Is there any way we can save the return value of a
> Javascript function into a file. For e.g.
>

 This is the 'servlet-interest' list. As you might have
guessed from the name, it's reserved for questions that
have  something to do with servlets. You question has
nothing to do with servlets, so it's inappropriate for
this forumn. It's considered impolite to ask off topic
questions.

 You might check google:

   http://www.google.com

 it's a search engine that's very good for finding
answers to programming-related questions. There are
literally thousands of faq's, sites, mailing lists and
books dealing with javascript. A google search will
turn up many of them.

 Good luck, and thanks for helping to keep servlet
interest a clean, fast and efficient place to talk
about servlets.


-cks

___________________________________________________________________________
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