Hi,

I am not trying to learn poi,  I need it urgently for work.
Someone please help. Here is the code in my servlet:
*

protected* *void* doGet(HttpServletRequest request, HttpServletResponse
response) *throws* ServletException, IOException {

// *TODO* Auto-generated method stub

*try* {

response.setContentType("application/vnd.ms-excel" );

// String filename = (String)request.getAttribute("selected");

HttpSession session = request.getSession();

String *filename* = (String)session.getAttribute("selected");

String path = "test.xls";

response.setHeader("Content-disposition", "inline;filename="+path);

// HSSFWorkbook wb = new HSSFWorkbook();

InputStream inp = *new* FileInputStream(path);

//InputStream inp = new FileInputStream("workbook.xlsx");

 Thanks in advance,



On Mon, Oct 26, 2009 at 4:16 PM, Kalpana <[email protected]> wrote:

> veena pandit <v.kris21 <at> gmail.com> writes:
>
> >
> > I am doing exactly what the sample code you are pointing to says to do.
> > But it does not open up the xls file in the browser.  It opens an empty
> > sheet.
> > I dont know if it is reading the file or not.
> >
> > THanks,
> >
> > Veena
> >
> > >
> I am not sure about opening an Xls file in a browser. Does test.xls have
> anything in it to be shown?
>
> If you are trying to learn how to work with xls files using POI, then I
> would
> suggest you try it out in standalone apps, and then get into opening them
> in
> browsers.
>
> Regards,
> Kalpana
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to