Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
Thread Tools Display Modes
  #1 (permalink)  
Old May 19th, 2004, 05:14 AM
Registered User
Join Date: May 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Parsing special characters from java to excel


I know this isn't _exactly_ J2EE but it IS in a J2EE application, so I'm hoping you might help:

I am creating a web report from db data which is shown in the browser as xls. I use the jakarta HSSF package to create the file, then I open it in a browser via a simple jsp and this all goes well. However, in this file I try to write the special character for 'delta'("\u0394" or #916;) and I just cant write it to the xls file. I mean, I can copy/paste it to it but if I type it in in the java file, I just get the 'square' (unknown character) in my xls document. I thought about setting content type for the window I'm opening but since I open the page via window.open(), I'm not sure if this is possible.

// code snippet for creating the xls file
int nRows = 0;
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet();
HSSFRow row = sheet.createRow(nRows);
row.createCell((short)1).setCellValue("\u0394" + "reading");
// end snippet

I then set the url to the file created in the request and forward to the jsp page that is to open the xls document:

//code snippet for the jsp that opens the xls:
  URL url = (URL)request.getAttribute("url");
    <script type="text/javascript">
    <title>XLS Report</title>
// end snippet

How on Earth do I get it to accept my 'delta' character??
Suggestions of all kinds are highly appreciated :)


live long and prosper..
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
storing special special characters in nvarchar... ACE2084 SQL Server 2000 2 February 9th, 2005 10:45 AM
SPECIAL characters... IIF MER78 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 December 23rd, 2004 04:32 PM
Substring and special characters geordaa XSLT 4 September 24th, 2004 02:27 AM
special characters lian_a Classic ASP Basics 3 June 23rd, 2004 05:16 AM

All times are GMT -4. The time now is 01:58 PM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.