Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Using jxl apis for prompting user to enter location for excel sheet?

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using alfresco 3.1.1 over jboss 4.3.2 ga.Here i have a requirement that user should see a link to export content which is there in content repository & which he should see in a tabular form to be exported to an excel sheet.For this i am using JXL apis.Its working in windows as i am putting some location under c:\ drive as location for the sheet.But our production environment is Linux & this logic is not working there.So i want that when user clicks on export link he should either see a file pop up which asks him to put a location for the sheet which he can browse like my documents or my computer , name the sheet & click on save , it should save the sheet at that particular location or he should see a download pop up with some predefined excel sheet name & prompts user to either open or save it as usually happens while we download some item from internet.
I am googling for it but not got any help till now.Can anybody help me out for this?
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to set the Content-Type and Content-Disposition headers. The former should be something like "application/vnd.ms-excel", and the latter maybe "attachment; filename=\"myTable.xls\"".

Of course, the user may have set her browser to silently save downloads; in that case, she'll never see the popup dialog (but you can assume that she knows what she's doing, so all is well).
 
J Lalit
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I may try this : create excel sheet using jxl apis & place it at a temporary location on server & then invoke a servlet which will dump the sheet from that temp location to user specified location using file store pop up which prompts user for location to store file say “My Documents” & then delete the sheet.
 
The moustache of a titan! The ad of a flea:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!