1. reference the poi package.
Http://download.csdn.net/detail/bucce/4356293
2. Export program modification.
Fileinputstream file = NULL;
Outputstream out = NULL;
Workbook WB = NULL;
Sheet sheet = NULL;
WB = new sxssfworkbooks (1000 );
Sheet = WB. createsheet ("csdaa010 ");
Int start = 0;
Int Limit = 60000;
Boolean B = true;
While (B)
{
Selectsetbiitirannmodel. setstart (start );
Selectsetbiitirannmodel. setlimit (Limit );
Long stimee = java. util. Calendar. getinstance (). gettimeinmillis ();
List <sda_va_daicho_a> kenngla kusetubidaitixyoukannri = itiranservice. kenngkusetubidaitixyoukannria (selectsetbiitirannmodel );
Double DB = double. parsedouble (Java. util. Calendar. getinstance (). gettimeinmillis ()-stimee) + "") * 0.001;
System. out. println ("th" + IE + "------------" + double. parsedouble (Java. util. calendar. getinstance (). gettimeinmillis ()-stimee) + "") * 0.001 + "second"); ie ++;
If (kenngkusetubidaitixyoukannri. Size () <limit)
{
B = false;
} Else
{
Start + = limit;
}
}
Response. setcontenttype ("application/octet-stream ");
Response. setheader ("content-disposition", "attachment; filename =" + outname );
Out = response. getoutputstream ();
WB. Write (out );
Third: style code
// =
Cellstyle styletb1 = WB. createcellstyle ();
Styletb1.setborderbottom (cellstyle. border_thin );
Styletb1.setbottombordercolor (indexedcolors. Black. getindex ());
Styletb1.setbordertop (cellstyle. border_thin );
Styletb1.settopbordercolor (indexedcolors. Black. getindex ());
// | =
Cellstyle styletb2 = WB. createcellstyle ();
Styletb2.setborderbottom (cellstyle. border_thin );
Styletb2.setbottombordercolor (indexedcolors. Black. getindex ());
Styletb2.setborderleft (cellstyle. border_thin );
Styletb2.setleftbordercolor (indexedcolors. Black. getindex ());
Styletb2.setbordertop (cellstyle. border_thin );
Styletb1.settopbordercolor (indexedcolors. Black. getindex ());
// = |
Cellstyle style137= WB. createcellstyle ();
Styletb3.setborderright (cellstyle. border_thin );
Styletb3.setrightbordercolor (indexedcolors. Black. getindex ());
Styletb3.setborderbottom (cellstyle. border_thin );
Styletb3.setbottombordercolor (indexedcolors. Black. getindex ());
Styletb3.setbordertop (cellstyle. border_thin );
Styletb1.settopbordercolor (indexedcolors. Black. getindex ());
// | = |
Cellstyle styletb4 = WB. createcellstyle ();
Styletb4.setborderright (cellstyle. border_thin );
Styletb4.setrightbordercolor (indexedcolors. Black. getindex ());
Styletb4.setborderbottom (cellstyle. border_thin );
Styletb4.setbottombordercolor (indexedcolors. Black. getindex ());
Styletb4.setborderleft (cellstyle. border_thin );
Styletb4.setleftbordercolor (indexedcolors. Black. getindex ());
Styletb4.setbordertop (cellstyle. border_thin );
Styletb1.settopbordercolor (indexedcolors. Black. getindex ());