This week's giveaway is in the Groovy forum.
We're giving away four copies of Groovy Fundamentals video training course and have Ken Kousen on-line!
See this thread for details.
The moose likes JSP and the fly likes JSP  to OpenOffice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP  to OpenOffice" Watch "JSP  to OpenOffice" New topic

JSP to OpenOffice

Subhradip Podder
Ranch Hand

Joined: Aug 27, 2007
Posts: 36
I was develop a report section in my project where the output is converted from jsp to excel format and i was succesful to develop that.

But now a days we can use OpenOffice and then i face a problem,because i'm unable to generated output from jsp to OpenOffice.

In Excel my code like bellow....

<%@ page contentType="application/" %>
<%@ page language="java" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>

<title>WCT Report</title>
<tr><th colspan="4"><b>WCT Report</b></th></tr>
<th>Vendor Name:</th>

<% PreparedStatement ps=null;
Connection con=null;
ResultSet rs=null;
int m=0;
String f_date=request.getParameter("f_date");
String t_date=request.getParameter("t_date");


{ %>
<td><%= rs.getString(1) %> </td>


Please help me to give your valuable suggestion......
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

First, it's important to realize that you're not converting anything to Excel format with the code you've posted.
All you did was set the content type which causes the browser to open your textual output in Excel.

If Open Office is installed on the user's machine and the mime types associations are set in their browser you should be able to do the same thing.
Here is a list of the mime types used by Open Office.
[ March 15, 2008: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
It is sorta covered in the JavaRanch Style Guide.
subject: JSP to OpenOffice