Jxl. jar jxls-core-0.9.9.jarjxls-reader-0.9.9.jarpoi-3.5-FINAL.jar (must be a version later than 3.5) other jar according to the prompts can go to the http://jarvana.com/jarvana/ to find // generate EXCEL input template file to generate the content of the file to return the complete path of the generated file public static string doexcel (string from, map beans, string to) {servletcontext SC = (servletcontext) actioncontext. getcontext (). get (servletactioncontext. servlet_context); string Path = SC. getrealpath ("/model"); xlstransformer transformer = N EW xlstransformer (); string sfrom = path + "\" + from; // template file string sto = path + "\" +; // try {transformer. transformxls (sfrom, beans, STO);} catch (parsepropertyexception e) {// todo auto-generated catch blocke. printstacktrace ();} catch (ioexception e) {// todo auto-generated catch blocke. printstacktrace ();} return sto;} // download public static void dodownload (string path, string name, httpservl Etresponse response) {try {response. reset (); response. setheader ("content-disposition", "attachment; success = true; filename =" + urlencoder. encode (name, "UTF-8"); bufferedinputstream Bis = NULL; bufferedoutputstream Bos = NULL; outputstream Fos = NULL; inputstream FD = NULL; file uploadfile = new file (PATH ); FS = new fileinputstream (uploadfile); Bis = new bufferedinputstream (FS); Fos = response. getoutputstr EAM (); Bos = new bufferedoutputstream (FOS); // the pop-up Download Dialog Box int bytesread = 0; byte [] buffer = new byte [8192]; while (bytesread = bis. read (buffer, 0, 8192 ))! =-1) {Bos. write (buffer, 0, bytesread);} Bos. flush (); FCM. close (); bis. close (); FOS. close (); Bos. close ();} catch (exception e) {e. printstacktrace () ;}} call: List resultlist = new arraylist (); For (INT I = 0; I <list. size (); I ++ ){...... Inspectionstisfaction Vo = new inspectionstisfaction (); vo. setxjrq (systemutil. gettimestr2str (string. valueof (map. get ("apply_date"); vo. setxjsl (lxjsl); vo. setfcmy (lfcmy); vo. setmy (lmy); vo. setyb (lyb); vo. setbmy (lbmy); vo. setfcbmy (lfcbmy); resultlist. add (VO);} // generate excelmap beans = new hashmap (); beans. put ("resultlist", resultlist); string Path = systemutil. doexcel ("Inspection merchant satisfaction Report Template .xls", beans, "Inspection merchant satisfaction report .xls"); systemutil. dodownload (path, "Inspection merchant satisfaction report .xls", this. response); return NULL; Template style: number of inspection (items) Overall Satisfaction satisfaction general dissatisfaction total <JX: foreach items = "$ {resultlist}" Var = "L" >$ {L. xjrq }$ {L. xjsl }$ {L. fcmy }$ {L. my} $ {L. yb} $ {L. bmy} $ {L. fcbmy} $ [B # + C # + D #] </JX: foreach> total number of months (count) $ [sum (B4)] $ [sum (D4)] $ [sum (E4)] $ [sum (F4)] $ [sum (G4)] $ [sum (h4)] $ [sum (I4)]