Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6356057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:53:28+00:00 2026-05-24T22:53:28+00:00

I have an app that I need to display Unicode information to an excel

  • 0

I have an app that I need to display Unicode information to an excel spreadsheet that is converted from a table in JSP. The unicode info displays correctly in JSP, but in Excel, it does not show international characters.

Basically to show the jsp table in Excel and start with the following line:

response.setHeader("Content-Disposition","attachment;filename=report.xls");

Then below there are <td>'s and <tr>'s that display the information in a tabular format.

I’m thinking I need another line under the response.setHeader line in order for unicode to render correctly.

Any thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:53:29+00:00Added an answer on May 24, 2026 at 10:53 pm

    You shouldn’t fool Excel with a HTML <table> with the wrong content type and file extension. Rather use a servlet to create a real and fullworthy binary XLS file with help of for example Apache POI HSSF or JExcelAPI. They’ll take care about the proper character encoding.

    You can find a basic kickoff example in the JExcelAPI FAQ, check the section How do I output an Excel file from a Servlet? Here’s an extract of relevance (disclaimer: this is a 100% copypaste, it’s not my code style and the class should actually be placed inside a package):

    import java.io.IOException;
    import java.io.OutputStream;
    
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    import jxl.Workbook;
    import jxl.write.Label;
    import jxl.write.WritableSheet;
    import jxl.write.WritableWorkbook;
    
    public class Sample extends HttpServlet
    {
     public void doGet(HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException
     {
      OutputStream out = null;
      try
      {
       response.setContentType("application/vnd.ms-excel");
       response.setHeader("Content-Disposition", "attachment; filename=sampleName.xls");
       WritableWorkbook w = Workbook.createWorkbook(response.getOutputStream());
       WritableSheet s = w.createSheet("Demo", 0);
       s.addCell(new Label(0, 0, "Hello World"));
       w.write();
       w.close();
      } catch (Exception e)
      {
       throw new ServletException("Exception in Excel Sample Servlet", e);
      } finally
      {
       if (out != null)
        out.close();
      }
     }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a third-party app that creates HTML-based reports that I need to display.
I have an app that will display Lotto Max numbers, I need to make
I have an app that loads records from a binary log file and displays
I am developing an app that need to display information on the stock of
I've created a simple Facebook app that doesn't need any data/info from users. When
I have an app that I need to get the source code to update
I have a Rails app that I need to deploy. Here are the facts:
I have an app that normal users need to be able to run, but
I have a VB app that I need to monitor while it is running.
have an app that finds your GPS location successfully, but I need to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.