aspose file tools*
The moose likes JSP and the fly likes Jsp to open office Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp to open office" Watch "Jsp to open office" New topic
Author

Jsp to open office

Subhradip Podder
Ranch Hand

Joined: Aug 27, 2007
Posts: 36
HI All,

I have write program which can convert jsp to excel format & i use MIME type is <%@ page contentType="application/vnd.ms-excel" %>.

Now a days my company use open office 2.4. So my program is failed to convert open office(spreadsheet) format.

Can anybody help me to tell which MIME type i can use to solve this.

Following is my program.

<%@ page contentType="application/vnd.ms-excel" %>
<%@ page language="java" %>
<%@ page import="java.sql.*" %>
........................
.......................

<% PreparedStatement ps=null;
Connection con=null;
ResultSet rs=null;
int m=0;
Class.forName("oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection("jdbcracle:thin:@172.16.90.139:1531:PROD","apps","apps");
String f_date=request.getParameter("f_date");
String t_date=request.getParameter("t_date");

ps=con.prepareStatement("SELECT PV.VENDOR_NAME VNAME,FV.DESCRIPTION STATE,to_char(AIA.GL_DATE,'dd-mon-yyyy') GL_DATE,to_char
......................
.......................


ps.setString(1,f_date);
ps.setString(2,t_date);
rs=ps.executeQuery();

%>
</table>
</body>
</html
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

See this link for a list of Open Office mime types:
http://framework.openoffice.org/documentation/mimetypes/mimetypes.html


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39576
    
  27
It may not work this way with OpenOffice. What this code creates is not an Excel file, it is an HTML table. Excel just happens to be able to read HTML files that contain tables, and imports those into sheets. Before you go further down this road, make sure that OpenOffice is capable of doing that, too. I wouldn't be surprised if it isn't.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jsp to open office
 
Similar Threads
Reporting in XLS format
add data to database using JSP script
How to save a file in client machine
JSP to OpenOffice
JSP to Excel Conversion