JSP implementation report Download
<%@ Page ContentType="text/html; Charset=utf-8" %><%@ taglib URI="Http://java.sun.com/jsp/jstl/core"prefix="C" %><%Response.setcontenttype ("Application/vnd.ms-excel;charset=utf-8"); %><!--set file name of download file -<!--set Excel to display mode -<!--<% response.setheader ("content-disposition", "inline; Filename=test.xls");%> -<!--set Excel to download mode -<%Response.setheader ("content-disposition","attachment; Filename=test.xls"); %><HTML><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><Head><title>Report</title> </Head><Body> <CENTER> <Tablecellpadding= "1"cellspacing= "1"Border= "1"> <TR> <TDcolspan= "5"Align= "Center">Report</TD> </TR> <TRclass= "Dan_tr"> <th>Use time</th> <th>User</th> <th>Communicators</th> <th>Where to use</th> <th>Consumption points</th> </TR> <C:foreachvar= "List"Items= "${list}"> <TRAlign= "Center"> <TDwidth= "135">${list.userdate}</TD> <TDwidth= "+">${list.username}</TD> <TDwidth= "+">${list.pusername}</TD> <TDwidth= " the">${list.usercorp}</TD> <TD>${list.integral} minutes</TD> </TR> </C:foreach> </Table> </CENTER></Body></HTML>
JSP generates Excel report