Excel using Jakarta POI


Web tier: servlets, JSP, Web frameworks: Excel using Jakarta POI

  1. Excel using Jakarta POI (2 messages)

    I have a JSP that writes output in Excel format. I have set the response ContentType to "application/vnd.ms-excel". The POI class i.e. HSSFWorkbook class allows output to be written to a ServletOuputStream.

    However when the page displays as an Excel on the browser, the Data is in a mode that is not English (it is probably in binary mode).

    Any input on where I could be going wrong is greatly appreciated!!!

    BTW - the reason why I am using POI in the first place is to control the formatting of data. We have some business data (that is numeric in nature) but when Excel opens it, the leading zeros get truncated rendering the data incorrect. With POI/HSSF I can specify that the format of the cell is "Text" which actually preserves the leading zeros.

    Threaded Messages (2)

  2. Excel using Jakarta POI[ Go to top ]

    Try using a servlet instead of JSP. The reason for that is JSP is taking a Writer and not OutputStream.

  3. Excel using Jakarta POI[ Go to top ]

    Thanks a million.

    That seemed to work.