|
-
the contentType attribute
Hi there,
I'm working on a JSP page that displays a report and wanted to allow the user to display the content either in HTML (the default) or as an Excel spreadsheet. According to Marty Halls book, Core Servlets and JavaServer Pages, Excel is able to interpret HTML tables and all one needs to do is simply set the contentType to "application/vnd.ms-excel".
<%
String format = request.getParameter("format");
if((format != null) && (format.equals("excel")))
{
response.setContentType("application/vnd.ms-excel");
}
%>
So I did, and it worked, except for one little glitch. In the first column labelled "Days Missed", in the report, I have strings that are either 1-3, or 4-6 or 8-10 (obviously these indicate a range of days missed). When Excel loads these values it mistakenly displays them as date fields: 01-Mar, 04-Jun, 07-Sep.
Is there some way to rig this so that Excel doesn't interpret the strings as dates?
Alan
Similar Threads
-
Replies: 1
Last Post: 10-31-2005, 01:57 PM
-
Replies: 1
Last Post: 03-15-2005, 05:15 PM
-
Replies: 1
Last Post: 04-26-2001, 03:20 AM
-
By Brandon Forest in forum XML
Replies: 0
Last Post: 12-22-2000, 03:40 PM
-
By Noga Atsil in forum XML
Replies: 1
Last Post: 11-21-2000, 12:04 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks