Writableworkbook WWB = NULL;
Writablesheet Ws = NULL;
Outputstream OS = response. getoutputstream ();
WWB = Workbook. createworkbook (OS );
Ws = WWB. createsheet ("employee ID", 0 );
WS. getsettings (). setdefacolumcolumnwidth (15 );
WS. setcolumnview (0, 20 );
WS. setcolumnview (1, 20 );
WS. setcolumnview (2, 80 );
Label Label = new label (0, 0, "date ");//
Column row name
WS. addcell (Label );
Label = new label (1, 0, "salary ");
WS. addcell (Label );
Label = new label (2, 0, "increase ");
WS. addcell (Label );
Response. setcontenttype ("application/vnd. MS-excel ");
Response. setheader ("content-disposition", "attachment; filename =" +
New String (titlename). getbytes ("GBK"), "iso8859-1 ") + ". Xls ");
If (null! = Pro_list & pro_list.size ()> 0 ){
Map onemap = NULL;
For (INT I = 0; I <pro_list.size (); I ++ ){
Onemap = pro_list.get (I );
Label = new label (0, (I + 1), commonstring. getformatpara (onemap. Get ("date ")));
WS. addcell (Label );
Label = new label (1, (I + 1), commonstring. getformatpara (onemap. Get ("money ")));
WS. addcell (Label );
Label = new label (2, (I + 1), commonstring. getformatpara (onemap. Get ("amplification"). Equals ("")? "0": commonstring. getformatpara (onemap. Get ("amplification") + "% ");
WS. addcell (Label );
}
}
WWB. Write ();
WWB. Close ();
OS. Close ();
OS = NULL;
Response. flushbuffer ();
Out. Clear ();
Out = pagecontext. pushbody ();