java代码插入wps java读取wps建的excel( 二 )


td width="33" height="27" style=" background:url(jsp/commonstyle/images/usermessage_01.gif); background-position:left; background-repeat:no-repeat;" /td
td width="965" class="style1"font color="black"驾校合格率排名/font/td
td width="14" height="27" style=" background:url(jsp/commonstyle/images/usermessage_03.gif); background-position:right; background-repeat:no-repeat;" /td
/tr
tr
td colspan="3"
!--页面主体内容开始--
!--查询条件--
form action="" name="formName" method="post" style="margin:0px" id="formName" theme="simple"
table width="100%" border="0" cellpadding="0" cellspacing="0"style="border-collapse:collapse;" id="tj" align="center"
tr align="left"
td class="tjbg1" style="text-align: left"
!-- input type="hidden" id="method"name="method" value="https://www.04ip.com/post/getHglpm"/ --
统计日期:
input type="text" name="tjjxkshgl.jzrq" id="jzrqId" value="https://www.04ip.com/post/s:property value="tjjxkshgl.jzrq"/" onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM'})"/
!-- 驾校名称:
s:select id="jxmcId"name="tjjxkshgl.jxxh"value="https://www.04ip.com/post/tjjxkshgl.jxxh" list="schoolList" listKey="jxxh" listValue="https://www.04ip.com/post/jxmc" headerKey="" headerValue="https://www.04ip.com/post/--请选择--" theme="simple"/s:select--
input name="input" value="https://www.04ip.com/post/统 计" type="button" class="normalbtn" onClick="serch()" style="margin-bottom: 5px" /
input name="input" type="button" value="https://www.04ip.com/post/合格率图表" onclick="tbbt()" class="normalbtn" style="margin-bottom: 5px" /
input id="Button1" type="button" value="https://www.04ip.com/post/导 出" onclick="openwd();" class="normalbtn" style="margin-bottom: 5px" /
/td
/tr
/table!--查询结果--
/form
!--查询结果--
table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#abcfff" id="cxjg" align="center"
thead
tr class="tbtitle"
td width="4%" align="center" class="t1"名次/td
td width="8%" align="center" class="t1"名称/td
td class="t1" width="5%" align="center"科目一/td
td class="t1" width="5%" align="center"科目二/td
td class="t1" width="5%" align="center"科目三/td
td class="t1" width="5%" align="center"平均合格率/td
td class="t1" width="5%" align="center"操作/td
/tr
/thead
s:iterator id="jxhgl" value="https://www.04ip.com/post/jxhelpmList" status="st"
tr class="changeColor" onMouseOver="overIt()" onMouseOut="outIt()" style="cursor: hand" align="center"
tds:property value="https://www.04ip.com/post/#st.index+1"//td
tds:property value="https://www.04ip.com/post/#jxhgl.jxmc"//td
tds:property value="https://www.04ip.com/post/#jxhgl.km1hgl"//td
tds:property value="https://www.04ip.com/post/#jxhgl.km2hgl"//td
tds:property value="https://www.04ip.com/post/#jxhgl.km3hgl"//td
tds:property value="https://www.04ip.com/post/#jxhgl.avghgl"/%/td
td
a href="javascript:" onclick="openWin('%=basePath %hgltj.action?method=getTbForJxxhtjjxkshgl.jxxh=s:property value="https://www.04ip.com/post/#jxhgl.jxxh"/tjjxkshgl.zt=1','',1250,750);"图表/a
/td
/tr
/s:iterator
/table
/table
/td
/tr
/table
/body
/html
2)java代码演示:
[java] view plaincopyprint?
/**
* 驾校合格率导出excel图表
*/
//response.getOutputStream();// 取得输出流
response.reset();// 清空输出流
String tmptitle = "驾校合格率排名"; // 标题
response.setHeader("Content-disposition", "attachment; filename="+new String(tmptitle.getBytes(),"iso8859-1")+".xls");// 设定输出文件头
response.setContentType("application/vnd.ms-excel");// 定义输出类型
wbook = Workbook.createWorkbook(os); // 建立excel文件
WritableSheet wsheet = wbook.createSheet(tmptitle, 0); // sheet名称

推荐阅读