The Artima Developer Community
Sponsored Link

Java Answers Forum
Exporting data from a servlet to a dynamically specified Excel file

1 reply on 1 page. Most recent reply: Oct 30, 2003 4:48 PM by Senthilnathan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Nandita

Posts: 10
Nickname: nanditasr
Registered: Aug, 2003

Exporting data from a servlet to a dynamically specified Excel file Posted: Oct 23, 2003 2:28 AM
Reply to this message Reply
Advertisement
Hi,
WHAT I AM CURRENTLY DOING
1. I am generating a report using data from an RDBMS (using JDBC:ODBC); I display this data on the browser through a servlet.
2. If the user wants to export this data, I put the results of that report into the Excel file.
3. To do this, I am specifying a DSN and name range, and sending data into that from my servlet (using JDBC:ODBC).

THE PROBLEM
I would like the user to pick a directory and file name for the Excel file on the fly (using the HTML tag <INPUT type=file>).

Once the user picks a file name, how can I export the data into this particular file, rather than what the DSN specifies?


Senthilnathan

Posts: 13
Nickname: ssnathan
Registered: Jul, 2003

Re: Exporting data from a servlet to a dynamically specified Excel file Posted: Oct 30, 2003 4:48 PM
Reply to this message Reply
I am not sure whether I understand ur problem correctly.
You are displaying some data in html format to the user. The user should be able to save the data shown in html format to his local hard disk. Is this the requirement?
If so, try this.
When the user wants to save the data to his local drive, you could save the data to a temp file in the server (the machine where web server is running) and give a link to the user. He should be able to download the file. The file can be deleted at the end of the session, or on the next hit to the servlet by the user or whatever option is convenient for you.

Flat View: This topic has 1 reply on 1 page
Topic: servlet exception Previous Topic   Next Topic Topic: RMI Registry Problem

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use