vijiruba 0 Newbie Poster

Hi,

I am trying to populate the JSP page content into Excel file. I am able to get this. But i have problem while trying to populate the string ("1/0") in Excel. This string is taken as date format in excel. But i want to display "1/0" as such.

Any suggestions !

I have copied my code below:

<%@ page language="java" %>
<%@ page import= "com.ti.emktcommon.util.CommonUtil" %>
<%@ taglib uri="/WEB-INF/lib/struts-bean.tld" prefix="bean" %>
 <html>
<head>
	<title>Dummy Page</title>
</head>

<%	
	 response.setContentType("application/vnd.ms-excel; charset=utf-8");
	 response.setHeader ("Content-Disposition", "attachment;filename=dummyfile.xls");
	 String dummy = "1/0";
%>
 <body>
	 <table cellSpacing=1 cellPadding=2 width="100%" border=1>
		 <tbody>
			<tr>
				<td>dfgdfgdfg</td>
				<td><%= dummy  %>&nbsp;</td>
				<td>111111111</td>
			</tr>
			<tr>
				<td>trytyuu</td>
				<td><%= dummy %></td>
				<td>2222222</td>
			</tr>
			<tr>
				<td>dfgdfgdfg</td>
				<td><%= dummy %></td>
				<td>333333333</td>
			</tr>
		 </tbody>
	</table>
</body>
</html>

Regards,
Vijiruba

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.