📄 summaryissuechart.jsp
字号:
<%@ include file="/includes/chartheader.jsp" %>
<%@ page errorPage="jasperError.jsp" %>
<%@ page import="dori.jasper.engine.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.awt.*" %>
<%@ page import="com.sourcetap.sfa.sql.*" %>
<%@ page import="org.ofbiz.entity.util.SequenceUtil" %>
<%@ page import="org.ofbiz.core.security.*" %>
<%@ page import="org.ofbiz.entity.*" %>
<%@ page import="org.ofbiz.entity.model.*" %>
<%@ page import="org.ofbiz.base.util.*" %>
<%@ page import="com.sourcetap.sfa.ui.*" %>
<%@ page import="com.sourcetap.sfa.event.*" %>
<%@ page import="com.sourcetap.sfa.util.UserInfo" %>
<jsp:useBean id="delegator" type="org.ofbiz.entity.GenericDelegator" scope="application" />
<% UserInfo userInfo = (UserInfo) session.getAttribute("userInfo");
String module = "summaryIssueChart";
%>
function Populate(){
setTitle("Pipline");
setAxis("Number of Issues");
<%
StringBuffer sbSql = new StringBuffer("select count(i.issue_id) as amount, i.priority_id as name1, i.status_id as name2 ");
sbSql.append(" from it_issue i ");
sbSql.append(" where i.status_id <> 'C' and ");
sbSql.append(" i.status_id <> 'X' ");
sbSql.append(" group by i.priority_id, i.status_id ");
sbSql.append(" order by i.priority_id ");
Connection connection = null;
PreparedStatement preparedStatement = null;
ResultSet rs = null;
try{
SQLUtil sqlUtil = new SQLUtil();
connection = sqlUtil.getConnection(delegator);
preparedStatement = connection.prepareStatement(sbSql.toString());
rs = preparedStatement.executeQuery();
String valueName = "";
int x = 0;
int y = 100;
boolean lbStop = false;
Double ldTemp = new Double(0.0);
double ldSimple = 0;
//new Double(returnAmount)
while ( rs.next() ){
x++;
valueName = rs.getString("name1");
valueName = valueName + " " + rs.getString("name2");
ldSimple = rs.getDouble("amount");
ldTemp = Double.valueOf(Double.toString(ldSimple));
y = ldTemp.intValue();
if (y < 1) {
y = 1;
}
%>
addChartValue(<%=y%>,"<%=valueName%>", true);
<%
}
} catch(SQLException e){
Debug.logError(e.getMessage(), module);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
e.printStackTrace(new PrintWriter(baos));
Debug.logError(new String(baos.toByteArray()), module);
} catch(Exception e){
e.printStackTrace();
Debug.logError(e.getMessage(), module);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
e.printStackTrace(new PrintWriter(baos));
Debug.logError(new String(baos.toByteArray()), module);
} finally {
try{
//if(resultSet != null) resultSet.close();
if(preparedStatement != null) preparedStatement.close();
if(connection != null) connection.close();
} catch (SQLException e){
Debug.logError(e.getMessage(), module);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
e.printStackTrace(new PrintWriter(baos));
Debug.logError(new String(baos.toByteArray()), module);
}
}
%>
}
<%@ include file="/includes/chartfooter.jsp" %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -