• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jsp to open office

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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("jdbc:oracle: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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See this link for a list of Open Office mime types:
http://framework.openoffice.org/documentation/mimetypes/mimetypes.html
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic