I used the code as follows in
jsp. still i can't get the excel o/p
<%!
RequestContext objRecCon = null;
HierListGroup objHLG = null;
public static Logger logger=Logger.getLogger("TEAMPAGES");
%>
<%
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-disposition","attachment; filename=" + "projectdata.xls" );
response.setHeader("Cache-Control", "max-age=0");
try
{
objRecCon = (RequestContext) request.getAttribute(IWidgetsKeys.REQUEST_CONTEXT);
}
catch(Exception ex)
{
ex.printStackTrace();
}
Logger logger=Logger.getLogger("TEAMPAGES");
String strOutput = "";
try{
int lintTeamID = Integer.parseInt(request.getParameter("teamid"));
TeamTypeInfo info = new TeamTypeInfo();
String xmlStr = info.getTeamTypeInfo(lintTeamID,2,"true","true");
logger.debug("\n\n"+ xmlStr + "In: TPTeamInfo.jsp \n\n");
HashMap hmKey = new HashMap();
hmKey.put("Function",TPConstants.FUNCTION_TYPE);
hmKey.put("PhoneCommunication",TPConstants.PHONE_TYPE);
hmKey.put("Responsibilities",TPConstants.RESPONSIBILITY_TYPE);
hmKey.put("Addresses",TPConstants.ADDRESS_TYPE);
hmKey.put("PeoplePageURL",TPConstants.PEOPLE_PAGE_INFO_URL);
TPTransformer trans = new TPTransformer();
String xslFileName = "TPTeamInfo_excel.xsl";
strOutput = trans.doTransformation(xmlStr,xslFileName, hmKey);
//byte[] outPut = strOutput.getBytes();
//response.getOutputStream().write(outPut,0,outPut.length);
out.print(strOutput);
/*
if(strAction!=null && strAction.equalsIgnoreCase("DownloadExcel")){
try{
out.flush();
}
catch(IOException ioex)
{
logger.debug("Exception is : " + ioex.getMessage());
}
// Disable any further buffering inside the ResponseOutputStream
byte[] outPut = strOutput.getBytes();
response.getOutputStream().write(outPut,0,outPut.length);
}else{
out.print(strOutput);
}
*/
}catch(Exception e){
logger.debug(getClass().getName()+ " Exception is : " + e.getMessage());
}
%>
can any one help me to do the things