📄 prodfunlog_execl.jsp
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--程控功能状态及清单查询导出excel功能-->
<%@ page language="java" contentType="text/html; charset=GBK" %>
<%@ page import="com.doone.data.*"%>
<%@ page import="com.doone.util.*"%>
<%@ page import="com.doone.uurm.*"%>
<%@ page import="com.doone.fj1w.fjmgr.rpt.*"%>
<%@ page import="java.util.*"%>
<%!
String getHTMLString(String tmp) {
tmp = tmp.replaceAll("\'","'");
tmp = tmp.replaceAll("\"", """);
tmp = tmp.replaceAll("<", "<");
tmp = tmp.replaceAll(">", ">");
tmp = tmp.replaceAll("&", "&");
return tmp;
}
%>
<%
String queryType = request.getParameter("queryType");
String cityCode = request.getParameter("cc");
String clientType = request.getParameter("ct");
String startTime = request.getParameter("st");
String endTime = request.getParameter("et");
String time = request.getParameter("time");
String title = request.getParameter("title");
String boardId = request.getParameter("boardId");
String prodfun = request.getParameter("prodfun");
//String pageSize = request.getParameter("ps");
//String currentPage = request.getParameter("cp");
Map map = new HashMap();
map.put("queryType",queryType);
map.put("CITYCODE",cityCode);
map.put("CLIENTTYPE",clientType);
map.put("STARTTIME",startTime);
map.put("ENDTIME",endTime);
map.put("TIME",time);
map.put("BOARDID",boardId);
map.put("PRODFUN",prodfun);
//map.put("pageSize",pageSize);
//map.put("currentPage",currentPage);
ProdfunlogImpl prodfunlogImpl = new ProdfunlogImpl();
DataTable dt = prodfunlogImpl.getAllList(map);
StringBuffer buffer = new StringBuffer();
try {
StringBuffer content = new StringBuffer();
com.doone.data.DataColumnCollection dcs = dt.getColumns();
int colcount = dcs.getCount();
content.append("<ss:Row>\n");
for (int icol = 0;icol<colcount;icol++){
com.doone.data.DataColumn dc = dcs.getDataColumn(icol);
if(!dc.getColumnName().equals("FUNCODE")){
content.append("<ss:Cell ss:StyleID=\"wc0CEFE34C\"><ss:Data ss:Type=\"String\">");
content.append(dc.getColumnName());
content.append("</ss:Data>\n</ss:Cell>\n");
}
}
content.append("</ss:Row>\n");
for(int iresult=0;iresult<dt.getRows().getCount(); iresult++){
DataRow drresult = dt.getRow(iresult);
content.append("<ss:Row>\n");
for (int icol=0; icol<colcount;icol++){
com.doone.data.DataColumn dc = dcs.getDataColumn(icol);
String sTaoCanType = prodfunlogImpl.getTaoCanType(drresult.getString(4).trim(),map);
String sValue = drresult.getString(icol).trim();
if(!dc.getColumnName().equals("FUNCODE")){
String columnName = dc.getColumnName();
if(sValue.equals("普通号/取消套餐")) {
if(sTaoCanType.equals("1")) sValue = "普通号";
else sValue = "取消套餐";
}
if(columnName.equals("所操作套餐名称")) {
if(sValue.equals("取消套餐")) {
sValue = "没有套餐";
}
}
content.append("<ss:Cell><ss:Data ss:Type=\"String\">");
content.append(sValue.equals("")?" ":sValue.trim());
content.append("</ss:Data></ss:Cell>\n");
}
}
content.append("</ss:Row>\n");
}
buffer.append("<?xml version=\"1.0\"?>\n");
buffer.append("<ss:Workbook xmlns:x=\"urn:schemas-microsoft-com:office:excel\"\n xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\"\n xmlns:c=\"urn:schemas-microsoft-com:office:component:spreadsheet\">\n ");
buffer.append("<x:ExcelWorkbook>\n");
buffer.append("<x:ProtectStructure>False</x:ProtectStructure>\n");
buffer.append("<x:ActiveSheet>0</x:ActiveSheet>\n");
buffer.append("</x:ExcelWorkbook>\n");
buffer.append("<ss:Styles>\n");
buffer.append("<ss:Style ss:ID=\"Default\">\n ");
buffer.append("<ss:Alignment ss:Horizontal=\"Automatic\" ss:Rotate=\"0.0\" ss:Vertical=\"Bottom\"\n ss:ReadingOrder=\"Context\"/>\n");
buffer.append("<ss:Borders>\n</ss:Borders>\n");
buffer.append("<ss:Font ss:FontName=\"宋体\" ss:Size=\"10\" ss:Color=\"Automatic\" ss:Bold=\"0\"\n ss:Italic=\"0\" ss:Underline=\"None\"/>\n");
buffer.append("<ss:Interior ss:Color=\"Automatic\" ss:Pattern=\"None\"/>\n");
buffer.append("<ss:NumberFormat ss:Format=\"General\"/>\n");
buffer.append("<ss:Protection ss:Protected=\"1\"/>\n");
buffer.append("</ss:Style>\n");
buffer.append("<ss:Style ss:ID=\"wc0CEFE34C\">\n");
buffer.append("<ss:Alignment ss:Horizontal=\"Center\"/>\n");
buffer.append("<ss:Font ss:FontName=\"宋体\" ss:Size=\"10\" ss:Bold=\"1\"/>\n");
buffer.append("</ss:Style>\n");
buffer.append("</ss:Styles>\n ");
buffer.append("<c:ComponentOptions>\n");
buffer.append("<c:Label>\n");
buffer.append("<c:Caption>Microsoft Office Spreadsheet</c:Caption>\n");
buffer.append("</c:Label>\n ");
buffer.append("<c:MaxHeight>80%</c:MaxHeight>\n ");
buffer.append("<c:MaxWidth>80%</c:MaxWidth>\n ");
buffer.append("<c:NextSheetNumber>4</c:NextSheetNumber>\n ");
buffer.append("</c:ComponentOptions>\n ");
buffer.append("<x:WorkbookOptions>\n ");
buffer.append("<c:OWCVersion>10.0.0.4109</c:OWCVersion>\n");
buffer.append("<x:Height>7620</x:Height>\n");
buffer.append("<x:Width>15240</x:Width>\n");
buffer.append("</x:WorkbookOptions>\n");
buffer.append("<ss:Worksheet ss:Name=\"工作表\">\n ");
buffer.append("<x:WorksheetOptions>\n ");
buffer.append("<x:Selected/>\n ");
buffer.append("<x:ViewableRange>R1:R262144</x:ViewableRange>\n ");
buffer.append("<x:Selection>R1C1</x:Selection>\n ");
buffer.append("<x:TopRowVisible>0</x:TopRowVisible>\n ");
buffer.append("<x:LeftColumnVisible>0</x:LeftColumnVisible>\n ");
buffer.append("<x:ProtectContents>False</x:ProtectContents>\n ");
buffer.append("</x:WorksheetOptions>\n ");
buffer.append("<c:WorksheetOptions>\n </c:WorksheetOptions>\n ");
buffer.append("<ss:Table ss:DefaultColumnWidth=\"54.0\" ss:DefaultRowHeight=\"12.75\">");
buffer.append("<ss:Column ss:Width=\"54.0\" ss:AutoFitWidth=\"0\"/>");
buffer.append("<ss:Column ss:Width=\"120.0\" ss:AutoFitWidth=\"0\"/>");
buffer.append("<ss:Column ss:Width=\"54.0\" ss:AutoFitWidth=\"0\"/>");
buffer.append("<ss:Column ss:Width=\"100.0\" ss:AutoFitWidth=\"0\"/>");
buffer.append("<ss:Column ss:Width=\"250.0\" ss:AutoFitWidth=\"0\"/>");
buffer.append(content);
buffer.append("</ss:Table>\n</ss:Worksheet>\n");
buffer.append("</ss:Workbook>\n");
ExtString.replace(buffer, "&", "&");
ExtString.replace(buffer, "<", "<");
ExtString.replace(buffer, ">", ">");
ExtString.replace(buffer, "\"", """);
//response.reset();
//response.setContentType("application/vnd.ms-excel; charset=gbk");
//out.print(buffer);
//out.close();
//return ;
}
catch(Exception ex){
FileLogger.getLogger().warn(ex.getMessage(),ex);
}
%>
<html>
<head>
<meta content="text/html; charset=GB18030" http-equiv="content-type"/>
<title><%=title%>导出EXCEL</title>
</head>
<body style="margin: 0px">
<object width="100%" height="100%" classid="CLSID:0002E551-0000-0000-C000-000000000046" codebase="/manager/owc11.exe">
<param name="DataType" value="XMLDATA">
<param name="XMLData" value="<%= buffer%>">
<table width='100%' cellpadding='0' cellspacing='0' border='0' height='8'>
<tr>
<td bgColor='#336699' height='25' width='10%'> </td>
<td bgColor='#666666'width='85%'>
<font face='宋体' color='white' size='4'>
<b> 缺少 Microsoft Office Web Components</b>
</font>
</td>
</tr>
<tr>
<td bgColor='#cccccc' width='15'> </td>
<td bgColor='#cccccc' width='500px'><br>
<font face='宋体' size='2'>此网页要求 Microsoft Office Web Components。
<p align='center'> 一般装完Office后会自动安装该组件.</p></font><p><font face='宋体' size='2'>此网页同时要求 Microsoft Internet Explorer 5.01 或更高版本。</p><p align='center'><a href='http://www.microsoft.com/windows/ie/default.htm'> 单击此处安装最新的 Internet Explorer</a>.</font><br> </td></tr></table>
</object>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -