We had a need for a simple (single-sheet) spreadsheet. So, I just generated a 
CSV output streamwith the following content-type or headers, and this works 
fine (at least in Firefox, where it opens the file in XLS).

response.setContentType( "text/csv" );
response.addHeader( "Content-Disposition", "inline; filename=myfile.csv" );

I know  "text/csv" to be a valid mime-type, but not "application/csv".

Thanks,
Arun



________________________________
From: Didier Durand <durand.did...@gmail.com>
To: Google App Engine for Java <google-appengine-java@googlegroups.com>
Sent: Tuesday, 6 September 2011 9:52 AM
Subject: [appengine-java] Re: How to create excel file in servlet for google 
app engine application?

Hi,

Another way to do it is to use the spreadsheet api of Google Docs and
send your users there (they can retrieve the web spreadsheet as a file
if needed)

See http://code.google.com/apis/spreadsheets/

regards

didier

On Sep 5, 7:57 pm, Marcelo Liberato <mliber...@gmail.com> wrote:
> You should try Apache POI:http://poi.apache.org/
>
> On Sep 5, 7:24 am, Sawan Darekar <sawan.dare...@alphabricks.com>
> wrote:
>
> > i am developing cloud application which is hosted on google app engine and
> > in this i want to *generate excel file* on click of button through servlet.
>
> > i have done it on local machine but when i deploy my application on app
> > engine it shows error HTTP Error 500 Internal server error
>
> > i am using *jxl java api* for generating excel file
>
> > code that i have used is here
>
> > try
> > {
>
> >   //i have used following content type but didn't worked.....
>
> >   //response.setContentType("application/vnd.ms-excel");
>
> >   //response.setContentType("application/x-ms-excel");
>
> >   response.setContentType("application/CSV");
>
> >   WritableWorkbook w = Workbook.createWorkbook(response.getOutputStream());
>
> >   WritableSheet s = w.createSheet("Demo", 0);
>
> >   Label label = new Label(0, 2, "A label record");
>
> >   s.addCell(label);
>
> >   w.write();
>
> >   w.close();}
>
> > catch (Exception e)
> > {
>
> >       response.getOutputStream().println("Exception :"+e);}
>
> > finally
> > {
>
> > }
>
> > --
> > Thanks & Regards,
> > Raj
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to