| Author |
Any idea on Export an Excel Sheet in GWT
|
Harsha Bandaru
Greenhorn
Joined: Sep 23, 2010
Posts: 5
|
|
Hi all,
I am trying to export an excel sheet in GWT. When ever the user clicks on the Download button, a dialogue box should pop up asking the location to save the file and when the user hits submit button, an excel file should be downloaded to that location.
I am able to generate the excel sheet but i am not clear on how to show the pop up dialogue box.
Can any one help me on this problem please.
Thanks
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Moving to our GWT forum.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Duc Vo
Ranch Hand
Joined: Nov 20, 2008
Posts: 254
|
|
To force download dialog box to appear all you need is to set the "Content-disposition" to "attachment". It's nothing much to do with GWT.
For more information google the keyword "force download html".
|
“Everything should be as simple as it is, but not simpler.” Albert Einstein
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
|
Check out http://markmail.org/message/5tmtyrnmri5fl7pk
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
Harsha Bandaru
Greenhorn
Joined: Sep 23, 2010
Posts: 5
|
|
Hey
I was not able to unserstand where to set the content type in GWT. Is there any sample code explaining me how to do it? I am sorry but i am in bad need of it.
Thanks for your responses.
|
 |
Plutarco Gonzalez
Greenhorn
Joined: Jan 13, 2011
Posts: 2
|
|
Harsha Bandaru wrote:Hey
I was not able to unserstand where to set the content type in GWT. Is there any sample code explaining me how to do it? I am sorry but i am in bad need of it.
Thanks for your responses.
In my servlet I use this to create pdf report and send to user.
ServletOutputStream out = response.getOutputStream();
byte[] reporte = JasperExportManager.exportReportToPdf(jasperPrint);
response.setContentType("application/pdf");
response.setContentLength(reporte.length);
response.addHeader("content-disposition", "attachment; filename=\""+ reportFileName + "\"");
out.write(reporte, 0, reporte.length);
out.flush();
Harsha, how can I generate the excel sheet ?
|
 |
 |
|
|
subject: Any idea on Export an Excel Sheet in GWT
|
|
|