my application aim is to download and upload data from excel sheet to mysql and mysql to excel sheet

while downloading the data from mysql to excel my application fails, using Internet explorer . i can download only empty excel sheet and the data is not present.

the headers i have i have used are
Code:
response.setHeader("Content-Disposition", "inline; filename=" + title+".xls");
			response.setHeader("Cache-Control",
             "must-revalidate, post-check=0, pre-check=0");
			response.setHeader("Pragma", "no-cache");
			response.setHeader("Expires", "0");
			response.setContentType("application/vnd.ms-excel: xls, xlb: Microsoft Excel Document");
			ServletOutputStream ot = response.getOutputStream();
			byte[] blobdata1 = wb.getBytes();
		        int off = 0;
			int l = (int) wb.getBytes().length;
			log.debug("Document Length is " + l);
			ot.write(blobdata1, 0, l);
			ot.flush();
			ot.close();
			}
i would like to know how to set the headers and content type?..........

Last edited by shabbir; 10Apr2008 at 19:53.. Reason: Code block